/*! For license information please see 710.fddd3797.js.LICENSE.txt */ "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[710],{2891:(t,e,n)=>{n.d(e,{lg:()=>Z,xI:()=>ct});class i{constructor(t,e,n){this.eventTarget=t,this.eventName=e,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(t){this.unorderedBindings.add(t)}bindingDisconnected(t){this.unorderedBindings.delete(t)}handleEvent(t){const e=function(t){if("immediatePropagationStopped"in t)return t;{const{stopImmediatePropagation:e}=t;return Object.assign(t,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}(t);for(const t of this.bindings){if(e.immediatePropagationStopped)break;t.handleEvent(e)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((t,e)=>{const n=t.index,i=e.index;return ni?1:0}))}}class r{constructor(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((t=>t.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((t=>t.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((t,e)=>t.concat(Array.from(e.values()))),[])}bindingConnected(t){this.fetchEventListenerForBinding(t).bindingConnected(t)}bindingDisconnected(t,e=!1){this.fetchEventListenerForBinding(t).bindingDisconnected(t),e&&this.clearEventListenersForBinding(t)}handleError(t,e,n={}){this.application.handleError(t,`Error ${e}`,n)}clearEventListenersForBinding(t){const e=this.fetchEventListenerForBinding(t);e.hasBindings()||(e.disconnect(),this.removeMappedEventListenerFor(t))}removeMappedEventListenerFor(t){const{eventTarget:e,eventName:n,eventOptions:i}=t,r=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(n,i);r.delete(s),0==r.size&&this.eventListenerMaps.delete(e)}fetchEventListenerForBinding(t){const{eventTarget:e,eventName:n,eventOptions:i}=t;return this.fetchEventListener(e,n,i)}fetchEventListener(t,e,n){const i=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(e,n);let s=i.get(r);return s||(s=this.createEventListener(t,e,n),i.set(r,s)),s}createEventListener(t,e,n){const r=new i(t,e,n);return this.started&&r.connect(),r}fetchEventListenerMapForEventTarget(t){let e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e}cacheKey(t,e){const n=[t];return Object.keys(e).sort().forEach((t=>{n.push(`${e[t]?"":"!"}${t}`)})),n.join(":")}}const s={stop:({event:t,value:e})=>(e&&t.stopPropagation(),!0),prevent:({event:t,value:e})=>(e&&t.preventDefault(),!0),self:({event:t,value:e,element:n})=>!e||n===t.target},o=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function a(t){return"window"==t?window:"document"==t?document:void 0}function l(t){return t.replace(/(?:[_-])([a-z0-9])/g,((t,e)=>e.toUpperCase()))}function c(t){return l(t.replace(/--/g,"-").replace(/__/g,"_"))}function u(t){return t.charAt(0).toUpperCase()+t.slice(1)}function h(t){return t.replace(/([A-Z])/g,((t,e)=>`-${e.toLowerCase()}`))}function d(t){return null!=t}function f(t,e){return Object.prototype.hasOwnProperty.call(t,e)}const p=["meta","ctrl","alt","shift"];class g{constructor(t,e,n,i){this.element=t,this.index=e,this.eventTarget=n.eventTarget||t,this.eventName=n.eventName||function(t){const e=t.tagName.toLowerCase();if(e in m)return m[e](t)}(t)||b("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||b("missing identifier"),this.methodName=n.methodName||b("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=i}static forToken(t,e){return new this(t.element,t.index,function(t){const e=t.trim().match(o)||[];let n=e[2],i=e[3];return i&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${i}`,i=""),{eventTarget:a(e[4]),eventName:n,eventOptions:e[7]?(r=e[7],r.split(":").reduce(((t,e)=>Object.assign(t,{[e.replace(/^!/,"")]:!/^!/.test(e)})),{})):{},identifier:e[5],methodName:e[6],keyFilter:e[1]||i};var r}(t.content),e)}toString(){const t=this.keyFilter?`.${this.keyFilter}`:"",e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${t}${e}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(t){if(!this.keyFilter)return!1;const e=this.keyFilter.split("+");if(this.keyFilterDissatisfied(t,e))return!0;const n=e.filter((t=>!p.includes(t)))[0];return!!n&&(f(this.keyMappings,n)||b(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==t.key.toLowerCase())}shouldIgnoreMouseEvent(t){if(!this.keyFilter)return!1;const e=[this.keyFilter];return!!this.keyFilterDissatisfied(t,e)}get params(){const t={},e=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:i}of Array.from(this.element.attributes)){const r=n.match(e),s=r&&r[1];s&&(t[l(s)]=v(i))}return t}get eventTargetName(){return(t=this.eventTarget)==window?"window":t==document?"document":void 0;var t}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(t,e){const[n,i,r,s]=p.map((t=>e.includes(t)));return t.metaKey!==n||t.ctrlKey!==i||t.altKey!==r||t.shiftKey!==s}}const m={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:t=>"submit"==t.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function b(t){throw new Error(t)}function v(t){try{return JSON.parse(t)}catch(e){return t}}class y{constructor(t,e){this.context=t,this.action=e}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(t){const e=this.prepareActionEvent(t);this.willBeInvokedByEvent(t)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){const t=this.controller[this.methodName];if("function"==typeof t)return t;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(t){const{element:e}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:i}=this.context;let r=!0;for(const[s,o]of Object.entries(this.eventOptions))if(s in n){const a=n[s];r=r&&a({name:s,value:o,event:t,element:e,controller:i})}return r}prepareActionEvent(t){return Object.assign(t,{params:this.action.params})}invokeWithEvent(t){const{target:e,currentTarget:n}=t;try{this.method.call(this.controller,t),this.context.logDebugActivity(this.methodName,{event:t,target:e,currentTarget:n,action:this.methodName})}catch(e){const{identifier:n,controller:i,element:r,index:s}=this,o={identifier:n,controller:i,element:r,index:s,event:t};this.context.handleError(e,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(t){const e=t.target;return!(t instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(t))&&(!(t instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(t))&&(this.element===e||(e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class _{constructor(t,e){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver((t=>this.processMutations(t)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(t){this.started&&(this.mutationObserver.disconnect(),this.started=!1),t(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const t=new Set(this.matchElementsInTree());for(const e of Array.from(this.elements))t.has(e)||this.removeElement(e);for(const e of Array.from(t))this.addElement(e)}}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){"attributes"==t.type?this.processAttributeChange(t.target,t.attributeName):"childList"==t.type&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))}processAttributeChange(t,e){this.elements.has(t)?this.delegate.elementAttributeChanged&&this.matchElement(t)?this.delegate.elementAttributeChanged(t,e):this.removeElement(t):this.matchElement(t)&&this.addElement(t)}processRemovedNodes(t){for(const e of Array.from(t)){const t=this.elementFromNode(e);t&&this.processTree(t,this.removeElement)}}processAddedNodes(t){for(const e of Array.from(t)){const t=this.elementFromNode(e);t&&this.elementIsActive(t)&&this.processTree(t,this.addElement)}}matchElement(t){return this.delegate.matchElement(t)}matchElementsInTree(t=this.element){return this.delegate.matchElementsInTree(t)}processTree(t,e){for(const n of this.matchElementsInTree(t))e.call(this,n)}elementFromNode(t){if(t.nodeType==Node.ELEMENT_NODE)return t}elementIsActive(t){return t.isConnected==this.element.isConnected&&this.element.contains(t)}addElement(t){this.elements.has(t)||this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))}removeElement(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))}}class x{constructor(t,e,n){this.attributeName=e,this.delegate=n,this.elementObserver=new _(t,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(t){return t.hasAttribute(this.attributeName)}matchElementsInTree(t){const e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.selector));return e.concat(n)}elementMatched(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)}elementUnmatched(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)}elementAttributeChanged(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)}}function w(t,e,n){S(t,e).add(n)}function k(t,e,n){S(t,e).delete(n),function(t,e){const n=t.get(e);null!=n&&0==n.size&&t.delete(e)}(t,e)}function S(t,e){let n=t.get(e);return n||(n=new Set,t.set(e,n)),n}class E{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((t,e)=>t.concat(Array.from(e))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((t,e)=>t+e.size),0)}add(t,e){w(this.valuesByKey,t,e)}delete(t,e){k(this.valuesByKey,t,e)}has(t,e){const n=this.valuesByKey.get(t);return null!=n&&n.has(e)}hasKey(t){return this.valuesByKey.has(t)}hasValue(t){return Array.from(this.valuesByKey.values()).some((e=>e.has(t)))}getValuesForKey(t){const e=this.valuesByKey.get(t);return e?Array.from(e):[]}getKeysForValue(t){return Array.from(this.valuesByKey).filter((([e,n])=>n.has(t))).map((([t,e])=>t))}}class O{constructor(t,e,n,i){this._selector=e,this.details=i,this.elementObserver=new _(t,this),this.delegate=n,this.matchesByElement=new E}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(t){this._selector=t,this.refresh()}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(t){const{selector:e}=this;if(e){const n=t.matches(e);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(t,this.details):n}return!1}matchElementsInTree(t){const{selector:e}=this;if(e){const n=this.matchElement(t)?[t]:[],i=Array.from(t.querySelectorAll(e)).filter((t=>this.matchElement(t)));return n.concat(i)}return[]}elementMatched(t){const{selector:e}=this;e&&this.selectorMatched(t,e)}elementUnmatched(t){const e=this.matchesByElement.getKeysForValue(t);for(const n of e)this.selectorUnmatched(t,n)}elementAttributeChanged(t,e){const{selector:n}=this;if(n){const e=this.matchElement(t),i=this.matchesByElement.has(n,t);e&&!i?this.selectorMatched(t,n):!e&&i&&this.selectorUnmatched(t,n)}}selectorMatched(t,e){this.delegate.selectorMatched(t,e,this.details),this.matchesByElement.add(e,t)}selectorUnmatched(t,e){this.delegate.selectorUnmatched(t,e,this.details),this.matchesByElement.delete(e,t)}}class M{constructor(t,e){this.element=t,this.delegate=e,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((t=>this.processMutations(t)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const t of this.knownAttributeNames)this.refreshAttribute(t,null)}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){const e=t.attributeName;e&&this.refreshAttribute(e,t.oldValue)}refreshAttribute(t,e){const n=this.delegate.getStringMapKeyForAttribute(t);if(null!=n){this.stringMap.has(t)||this.stringMapKeyAdded(n,t);const i=this.element.getAttribute(t);if(this.stringMap.get(t)!=i&&this.stringMapValueChanged(i,n,e),null==i){const e=this.stringMap.get(t);this.stringMap.delete(t),e&&this.stringMapKeyRemoved(n,t,e)}else this.stringMap.set(t,i)}}stringMapKeyAdded(t,e){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(t,e)}stringMapValueChanged(t,e,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(t,e,n)}stringMapKeyRemoved(t,e,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(t,e,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((t=>t.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class C{constructor(t,e,n){this.attributeObserver=new x(t,e,this),this.delegate=n,this.tokensByElement=new E}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(t){this.attributeObserver.pause(t)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(t){this.tokensMatched(this.readTokensForElement(t))}elementAttributeValueChanged(t){const[e,n]=this.refreshTokensForElement(t);this.tokensUnmatched(e),this.tokensMatched(n)}elementUnmatchedAttribute(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))}tokensMatched(t){t.forEach((t=>this.tokenMatched(t)))}tokensUnmatched(t){t.forEach((t=>this.tokenUnmatched(t)))}tokenMatched(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)}tokenUnmatched(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)}refreshTokensForElement(t){const e=this.tokensByElement.getValuesForKey(t),n=this.readTokensForElement(t),i=function(t,e){const n=Math.max(t.length,e.length);return Array.from({length:n},((n,i)=>[t[i],e[i]]))}(e,n).findIndex((([t,e])=>{return i=e,!((n=t)&&i&&n.index==i.index&&n.content==i.content);var n,i}));return-1==i?[[],[]]:[e.slice(i),n.slice(i)]}readTokensForElement(t){const e=this.attributeName;return function(t,e,n){return t.trim().split(/\s+/).filter((t=>t.length)).map(((t,i)=>({element:e,attributeName:n,content:t,index:i})))}(t.getAttribute(e)||"",t,e)}}class A{constructor(t,e,n){this.tokenListObserver=new C(t,e,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(t){const{element:e}=t,{value:n}=this.fetchParseResultForToken(t);n&&(this.fetchValuesByTokenForElement(e).set(t,n),this.delegate.elementMatchedValue(e,n))}tokenUnmatched(t){const{element:e}=t,{value:n}=this.fetchParseResultForToken(t);n&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,n))}fetchParseResultForToken(t){let e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e}fetchValuesByTokenForElement(t){let e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e}parseToken(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(t){return{error:t}}}}class T{constructor(t,e){this.context=t,this.delegate=e,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new A(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(t){const e=new y(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)}disconnectAction(t){const e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))}disconnectAllActions(){this.bindings.forEach((t=>this.delegate.bindingDisconnected(t,!0))),this.bindingsByAction.clear()}parseValueForToken(t){const e=g.forToken(t,this.schema);if(e.identifier==this.identifier)return e}elementMatchedValue(t,e){this.connectAction(e)}elementUnmatchedValue(t,e){this.disconnectAction(e)}}class P{constructor(t,e){this.context=t,this.receiver=e,this.stringMapObserver=new M(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(t){if(t in this.valueDescriptorMap)return this.valueDescriptorMap[t].name}stringMapKeyAdded(t,e){const n=this.valueDescriptorMap[e];this.hasValue(t)||this.invokeChangedCallback(t,n.writer(this.receiver[t]),n.writer(n.defaultValue))}stringMapValueChanged(t,e,n){const i=this.valueDescriptorNameMap[e];null!==t&&(null===n&&(n=i.writer(i.defaultValue)),this.invokeChangedCallback(e,t,n))}stringMapKeyRemoved(t,e,n){const i=this.valueDescriptorNameMap[t];this.hasValue(t)?this.invokeChangedCallback(t,i.writer(this.receiver[t]),n):this.invokeChangedCallback(t,i.writer(i.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:t,name:e,defaultValue:n,writer:i}of this.valueDescriptors)null==n||this.controller.data.has(t)||this.invokeChangedCallback(e,i(n),void 0)}invokeChangedCallback(t,e,n){const i=`${t}Changed`,r=this.receiver[i];if("function"==typeof r){const i=this.valueDescriptorNameMap[t];try{const t=i.reader(e);let s=n;n&&(s=i.reader(n)),r.call(this.receiver,t,s)}catch(t){throw t instanceof TypeError&&(t.message=`Stimulus Value "${this.context.identifier}.${i.name}" - ${t.message}`),t}}}get valueDescriptors(){const{valueDescriptorMap:t}=this;return Object.keys(t).map((e=>t[e]))}get valueDescriptorNameMap(){const t={};return Object.keys(this.valueDescriptorMap).forEach((e=>{const n=this.valueDescriptorMap[e];t[n.name]=n})),t}hasValue(t){const e=`has${u(this.valueDescriptorNameMap[t].name)}`;return this.receiver[e]}}class L{constructor(t,e){this.context=t,this.delegate=e,this.targetsByName=new E}start(){this.tokenListObserver||(this.tokenListObserver=new C(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:t,content:e}){this.scope.containsElement(t)&&this.connectTarget(t,e)}tokenUnmatched({element:t,content:e}){this.disconnectTarget(t,e)}connectTarget(t,e){var n;this.targetsByName.has(e,t)||(this.targetsByName.add(e,t),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetConnected(t,e))))}disconnectTarget(t,e){var n;this.targetsByName.has(e,t)&&(this.targetsByName.delete(e,t),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetDisconnected(t,e))))}disconnectAllTargets(){for(const t of this.targetsByName.keys)for(const e of this.targetsByName.getValuesForKey(t))this.disconnectTarget(e,t)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function D(t,e){const n=I(t);return Array.from(n.reduce(((t,n)=>(function(t,e){const n=t[e];return Array.isArray(n)?n:[]}(n,e).forEach((e=>t.add(e))),t)),new Set))}function N(t,e){return I(t).reduce(((t,n)=>(t.push(...function(t,e){const n=t[e];return n?Object.keys(n).map((t=>[t,n[t]])):[]}(n,e)),t)),[])}function I(t){const e=[];for(;t;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}class F{constructor(t,e){this.started=!1,this.context=t,this.delegate=e,this.outletsByName=new E,this.outletElementsByName=new E,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((t=>{this.setupSelectorObserverForOutlet(t),this.setupAttributeObserverForOutlet(t)})),this.started=!0,this.dependentContexts.forEach((t=>t.refresh())))}refresh(){this.selectorObserverMap.forEach((t=>t.refresh())),this.attributeObserverMap.forEach((t=>t.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((t=>t.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((t=>t.stop())),this.attributeObserverMap.clear())}selectorMatched(t,e,{outletName:n}){const i=this.getOutlet(t,n);i&&this.connectOutlet(i,t,n)}selectorUnmatched(t,e,{outletName:n}){const i=this.getOutletFromMap(t,n);i&&this.disconnectOutlet(i,t,n)}selectorMatchElement(t,{outletName:e}){const n=this.selector(e),i=this.hasOutlet(t,e),r=t.matches(`[${this.schema.controllerAttribute}~=${e}]`);return!!n&&(i&&r&&t.matches(n))}elementMatchedAttribute(t,e){const n=this.getOutletNameFromOutletAttributeName(e);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(t,e){const n=this.getOutletNameFromOutletAttributeName(e);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(t,e){const n=this.getOutletNameFromOutletAttributeName(e);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(t,e,n){var i;this.outletElementsByName.has(n,e)||(this.outletsByName.add(n,t),this.outletElementsByName.add(n,e),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletConnected(t,e,n))))}disconnectOutlet(t,e,n){var i;this.outletElementsByName.has(n,e)&&(this.outletsByName.delete(n,t),this.outletElementsByName.delete(n,e),null===(i=this.selectorObserverMap.get(n))||void 0===i||i.pause((()=>this.delegate.outletDisconnected(t,e,n))))}disconnectAllOutlets(){for(const t of this.outletElementsByName.keys)for(const e of this.outletElementsByName.getValuesForKey(t))for(const n of this.outletsByName.getValuesForKey(t))this.disconnectOutlet(n,e,t)}updateSelectorObserverForOutlet(t){const e=this.selectorObserverMap.get(t);e&&(e.selector=this.selector(t))}setupSelectorObserverForOutlet(t){const e=this.selector(t),n=new O(document.body,e,this,{outletName:t});this.selectorObserverMap.set(t,n),n.start()}setupAttributeObserverForOutlet(t){const e=this.attributeNameForOutletName(t),n=new x(this.scope.element,e,this);this.attributeObserverMap.set(t,n),n.start()}selector(t){return this.scope.outlets.getSelectorForOutletName(t)}attributeNameForOutletName(t){return this.scope.schema.outletAttributeForScope(this.identifier,t)}getOutletNameFromOutletAttributeName(t){return this.outletDefinitions.find((e=>this.attributeNameForOutletName(e)===t))}get outletDependencies(){const t=new E;return this.router.modules.forEach((e=>{D(e.definition.controllerConstructor,"outlets").forEach((n=>t.add(n,e.identifier)))})),t}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const t=this.dependentControllerIdentifiers;return this.router.contexts.filter((e=>t.includes(e.identifier)))}hasOutlet(t,e){return!!this.getOutlet(t,e)||!!this.getOutletFromMap(t,e)}getOutlet(t,e){return this.application.getControllerForElementAndIdentifier(t,e)}getOutletFromMap(t,e){return this.outletsByName.getValuesForKey(e).find((e=>e.element===t))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class R{constructor(t,e){this.logDebugActivity=(t,e={})=>{const{identifier:n,controller:i,element:r}=this;e=Object.assign({identifier:n,controller:i,element:r},e),this.application.logDebugActivity(this.identifier,t,e)},this.module=t,this.scope=e,this.controller=new t.controllerConstructor(this),this.bindingObserver=new T(this,this.dispatcher),this.valueObserver=new P(this,this.controller),this.targetObserver=new L(this,this),this.outletObserver=new F(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(t){this.handleError(t,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(t){this.handleError(t,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(t){this.handleError(t,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(t,e,n={}){const{identifier:i,controller:r,element:s}=this;n=Object.assign({identifier:i,controller:r,element:s},n),this.application.handleError(t,`Error ${e}`,n)}targetConnected(t,e){this.invokeControllerMethod(`${e}TargetConnected`,t)}targetDisconnected(t,e){this.invokeControllerMethod(`${e}TargetDisconnected`,t)}outletConnected(t,e,n){this.invokeControllerMethod(`${c(n)}OutletConnected`,t,e)}outletDisconnected(t,e,n){this.invokeControllerMethod(`${c(n)}OutletDisconnected`,t,e)}invokeControllerMethod(t,...e){const n=this.controller;"function"==typeof n[t]&&n[t](...e)}}function z(t){return function(t,e){const n=$(t),i=function(t,e){return j(e).reduce(((n,i)=>{const r=function(t,e,n){const i=Object.getOwnPropertyDescriptor(t,n);if(!i||!("value"in i)){const t=Object.getOwnPropertyDescriptor(e,n).value;return i&&(t.get=i.get||t.get,t.set=i.set||t.set),t}}(t,e,i);return r&&Object.assign(n,{[i]:r}),n}),{})}(t.prototype,e);return Object.defineProperties(n.prototype,i),n}(t,function(t){const e=D(t,"blessings");return e.reduce(((e,n)=>{const i=n(t);for(const t in i){const n=e[t]||{};e[t]=Object.assign(n,i[t])}return e}),{})}(t))}const j="function"==typeof Object.getOwnPropertySymbols?t=>[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)]:Object.getOwnPropertyNames,$=(()=>{function t(t){function e(){return Reflect.construct(t,arguments,new.target)}return e.prototype=Object.create(t.prototype,{constructor:{value:e}}),Reflect.setPrototypeOf(e,t),e}try{return function(){const e=t((function(){this.a.call(this)}));e.prototype.a=function(){},new e}(),t}catch(t){return t=>class extends t{}}})();class B{constructor(t,e){this.application=t,this.definition=function(t){return{identifier:t.identifier,controllerConstructor:z(t.controllerConstructor)}}(e),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(t){const e=this.fetchContextForScope(t);this.connectedContexts.add(e),e.connect()}disconnectContextForScope(t){const e=this.contextsByScope.get(t);e&&(this.connectedContexts.delete(e),e.disconnect())}fetchContextForScope(t){let e=this.contextsByScope.get(t);return e||(e=new R(this,t),this.contextsByScope.set(t,e)),e}}class V{constructor(t){this.scope=t}has(t){return this.data.has(this.getDataKey(t))}get(t){return this.getAll(t)[0]}getAll(t){const e=this.data.get(this.getDataKey(t))||"";return e.match(/[^\s]+/g)||[]}getAttributeName(t){return this.data.getAttributeNameForKey(this.getDataKey(t))}getDataKey(t){return`${t}-class`}get data(){return this.scope.data}}class W{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(t){const e=this.getAttributeNameForKey(t);return this.element.getAttribute(e)}set(t,e){const n=this.getAttributeNameForKey(t);return this.element.setAttribute(n,e),this.get(t)}has(t){const e=this.getAttributeNameForKey(t);return this.element.hasAttribute(e)}delete(t){if(this.has(t)){const e=this.getAttributeNameForKey(t);return this.element.removeAttribute(e),!0}return!1}getAttributeNameForKey(t){return`data-${this.identifier}-${h(t)}`}}class H{constructor(t){this.warnedKeysByObject=new WeakMap,this.logger=t}warn(t,e,n){let i=this.warnedKeysByObject.get(t);i||(i=new Set,this.warnedKeysByObject.set(t,i)),i.has(e)||(i.add(e),this.logger.warn(n,t))}}function U(t,e){return`[${t}~="${e}"]`}class K{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return null!=this.find(t)}find(...t){return t.reduce(((t,e)=>t||this.findTarget(e)||this.findLegacyTarget(e)),void 0)}findAll(...t){return t.reduce(((t,e)=>[...t,...this.findAllTargets(e),...this.findAllLegacyTargets(e)]),[])}findTarget(t){const e=this.getSelectorForTargetName(t);return this.scope.findElement(e)}findAllTargets(t){const e=this.getSelectorForTargetName(t);return this.scope.findAllElements(e)}getSelectorForTargetName(t){return U(this.schema.targetAttributeForScope(this.identifier),t)}findLegacyTarget(t){const e=this.getLegacySelectorForTargetName(t);return this.deprecate(this.scope.findElement(e),t)}findAllLegacyTargets(t){const e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map((e=>this.deprecate(e,t)))}getLegacySelectorForTargetName(t){const e=`${this.identifier}.${t}`;return U(this.schema.targetAttribute,e)}deprecate(t,e){if(t){const{identifier:n}=this,i=this.schema.targetAttribute,r=this.schema.targetAttributeForScope(n);this.guide.warn(t,`target:${e}`,`Please replace ${i}="${n}.${e}" with ${r}="${e}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return t}get guide(){return this.scope.guide}}class Y{constructor(t,e){this.scope=t,this.controllerElement=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return null!=this.find(t)}find(...t){return t.reduce(((t,e)=>t||this.findOutlet(e)),void 0)}findAll(...t){return t.reduce(((t,e)=>[...t,...this.findAllOutlets(e)]),[])}getSelectorForOutletName(t){const e=this.schema.outletAttributeForScope(this.identifier,t);return this.controllerElement.getAttribute(e)}findOutlet(t){const e=this.getSelectorForOutletName(t);if(e)return this.findElement(e,t)}findAllOutlets(t){const e=this.getSelectorForOutletName(t);return e?this.findAllElements(e,t):[]}findElement(t,e){return this.scope.queryElements(t).filter((n=>this.matchesElement(n,t,e)))[0]}findAllElements(t,e){return this.scope.queryElements(t).filter((n=>this.matchesElement(n,t,e)))}matchesElement(t,e,n){const i=t.getAttribute(this.scope.schema.controllerAttribute)||"";return t.matches(e)&&i.split(" ").includes(n)}}class q{constructor(t,e,n,i){this.targets=new K(this),this.classes=new V(this),this.data=new W(this),this.containsElement=t=>t.closest(this.controllerSelector)===this.element,this.schema=t,this.element=e,this.identifier=n,this.guide=new H(i),this.outlets=new Y(this.documentScope,e)}findElement(t){return this.element.matches(t)?this.element:this.queryElements(t).find(this.containsElement)}findAllElements(t){return[...this.element.matches(t)?[this.element]:[],...this.queryElements(t).filter(this.containsElement)]}queryElements(t){return Array.from(this.element.querySelectorAll(t))}get controllerSelector(){return U(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new q(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class Q{constructor(t,e,n){this.element=t,this.schema=e,this.delegate=n,this.valueListObserver=new A(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(t){const{element:e,content:n}=t;return this.parseValueForElementAndIdentifier(e,n)}parseValueForElementAndIdentifier(t,e){const n=this.fetchScopesByIdentifierForElement(t);let i=n.get(e);return i||(i=this.delegate.createScopeForElementAndIdentifier(t,e),n.set(e,i)),i}elementMatchedValue(t,e){const n=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,n),1==n&&this.delegate.scopeConnected(e)}elementUnmatchedValue(t,e){const n=this.scopeReferenceCounts.get(e);n&&(this.scopeReferenceCounts.set(e,n-1),1==n&&this.delegate.scopeDisconnected(e))}fetchScopesByIdentifierForElement(t){let e=this.scopesByIdentifierByElement.get(t);return e||(e=new Map,this.scopesByIdentifierByElement.set(t,e)),e}}class X{constructor(t){this.application=t,this.scopeObserver=new Q(this.element,this.schema,this),this.scopesByIdentifier=new E,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((t,e)=>t.concat(e.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(t){this.unloadIdentifier(t.identifier);const e=new B(this.application,t);this.connectModule(e);const n=t.controllerConstructor.afterLoad;n&&n.call(t.controllerConstructor,t.identifier,this.application)}unloadIdentifier(t){const e=this.modulesByIdentifier.get(t);e&&this.disconnectModule(e)}getContextForElementAndIdentifier(t,e){const n=this.modulesByIdentifier.get(e);if(n)return n.contexts.find((e=>e.element==t))}proposeToConnectScopeForElementAndIdentifier(t,e){const n=this.scopeObserver.parseValueForElementAndIdentifier(t,e);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${e}" and element:`,t)}handleError(t,e,n){this.application.handleError(t,e,n)}createScopeForElementAndIdentifier(t,e){return new q(this.schema,t,e,this.logger)}scopeConnected(t){this.scopesByIdentifier.add(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.connectContextForScope(t)}scopeDisconnected(t){this.scopesByIdentifier.delete(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.disconnectContextForScope(t)}connectModule(t){this.modulesByIdentifier.set(t.identifier,t);this.scopesByIdentifier.getValuesForKey(t.identifier).forEach((e=>t.connectContextForScope(e)))}disconnectModule(t){this.modulesByIdentifier.delete(t.identifier);this.scopesByIdentifier.getValuesForKey(t.identifier).forEach((e=>t.disconnectContextForScope(e)))}}const G={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:t=>`data-${t}-target`,outletAttributeForScope:(t,e)=>`data-${t}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},J("abcdefghijklmnopqrstuvwxyz".split("").map((t=>[t,t])))),J("0123456789".split("").map((t=>[t,t]))))};function J(t){return t.reduce(((t,[e,n])=>Object.assign(Object.assign({},t),{[e]:n})),{})}class Z{constructor(t=document.documentElement,e=G){this.logger=console,this.debug=!1,this.logDebugActivity=(t,e,n={})=>{this.debug&&this.logFormattedMessage(t,e,n)},this.element=t,this.schema=e,this.dispatcher=new r(this),this.router=new X(this),this.actionDescriptorFilters=Object.assign({},s)}static start(t,e){const n=new this(t,e);return n.start(),n}async start(){await new Promise((t=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>t())):t()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(t,e){this.load({identifier:t,controllerConstructor:e})}registerActionOption(t,e){this.actionDescriptorFilters[t]=e}load(t,...e){(Array.isArray(t)?t:[t,...e]).forEach((t=>{t.controllerConstructor.shouldLoad&&this.router.loadDefinition(t)}))}unload(t,...e){(Array.isArray(t)?t:[t,...e]).forEach((t=>this.router.unloadIdentifier(t)))}get controllers(){return this.router.contexts.map((t=>t.controller))}getControllerForElementAndIdentifier(t,e){const n=this.router.getContextForElementAndIdentifier(t,e);return n?n.controller:null}handleError(t,e,n){var i;this.logger.error("%s\n\n%o\n\n%o",e,t,n),null===(i=window.onerror)||void 0===i||i.call(window,e,"",0,0,t)}logFormattedMessage(t,e,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${t} #${e}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function tt(t,e,n){return t.application.getControllerForElementAndIdentifier(e,n)}function et(t,e,n){let i=tt(t,e,n);return i||(t.application.router.proposeToConnectScopeForElementAndIdentifier(e,n),i=tt(t,e,n),i||void 0)}function nt([t,e],n){return function(t){const{token:e,typeDefinition:n}=t,i=`${h(e)}-value`,r=function(t){const{controller:e,token:n,typeDefinition:i}=t,r={controller:e,token:n,typeObject:i},s=function(t){const{controller:e,token:n,typeObject:i}=t,r=d(i.type),s=d(i.default),o=r&&s,a=r&&!s,l=!r&&s,c=it(i.type),u=rt(t.typeObject.default);if(a)return c;if(l)return u;if(c!==u){throw new Error(`The specified default value for the Stimulus Value "${e?`${e}.${n}`:n}" must match the defined type "${c}". The provided default value of "${i.default}" is of type "${u}".`)}if(o)return c}(r),o=rt(i),a=it(i),l=s||o||a;if(l)return l;const c=e?`${e}.${i}`:n;throw new Error(`Unknown value type "${c}" for "${n}" value`)}(t);return{type:r,key:i,name:l(i),get defaultValue(){return function(t){const e=it(t);if(e)return st[e];const n=f(t,"default"),i=f(t,"type"),r=t;if(n)return r.default;if(i){const{type:t}=r,e=it(t);if(e)return st[e]}return t}(n)},get hasCustomDefaultValue(){return void 0!==rt(n)},reader:ot[r],writer:at[r]||at.default}}({controller:n,token:t,typeDefinition:e})}function it(t){switch(t){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function rt(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(t)?"array":"[object Object]"===Object.prototype.toString.call(t)?"object":void 0}const st={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},ot={array(t){const e=JSON.parse(t);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${t}" of type "${rt(e)}"`);return e},boolean:t=>!("0"==t||"false"==String(t).toLowerCase()),number:t=>Number(t.replace(/_/g,"")),object(t){const e=JSON.parse(t);if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${t}" of type "${rt(e)}"`);return e},string:t=>t},at={default:function(t){return`${t}`},array:lt,object:lt};function lt(t){return JSON.stringify(t)}class ct{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(t,{target:e=this.element,detail:n={},prefix:i=this.identifier,bubbles:r=!0,cancelable:s=!0}={}){const o=new CustomEvent(i?`${i}:${t}`:t,{detail:n,bubbles:r,cancelable:s});return e.dispatchEvent(o),o}}ct.blessings=[function(t){return D(t,"classes").reduce(((t,e)=>{return Object.assign(t,(n=e,{[`${n}Class`]:{get(){const{classes:t}=this;if(t.has(n))return t.get(n);{const e=t.getAttributeName(n);throw new Error(`Missing attribute "${e}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${u(n)}Class`]:{get(){return this.classes.has(n)}}}));var n}),{})},function(t){return D(t,"targets").reduce(((t,e)=>{return Object.assign(t,(n=e,{[`${n}Target`]:{get(){const t=this.targets.find(n);if(t)return t;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${u(n)}Target`]:{get(){return this.targets.has(n)}}}));var n}),{})},function(t){const e=N(t,"values"),n={valueDescriptorMap:{get(){return e.reduce(((t,e)=>{const n=nt(e,this.identifier),i=this.data.getAttributeNameForKey(n.key);return Object.assign(t,{[i]:n})}),{})}}};return e.reduce(((t,e)=>Object.assign(t,function(t,e){const n=nt(t,e),{key:i,name:r,reader:s,writer:o}=n;return{[r]:{get(){const t=this.data.get(i);return null!==t?s(t):n.defaultValue},set(t){void 0===t?this.data.delete(i):this.data.set(i,o(t))}},[`has${u(r)}`]:{get(){return this.data.has(i)||n.hasCustomDefaultValue}}}}(e))),n)},function(t){return D(t,"outlets").reduce(((t,e)=>Object.assign(t,function(t){const e=c(t);return{[`${e}Outlet`]:{get(){const e=this.outlets.find(t),n=this.outlets.getSelectorForOutletName(t);if(e){const n=et(this,e,t);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${t}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${t}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${e}Outlets`]:{get(){const e=this.outlets.findAll(t);return e.length>0?e.map((e=>{const n=et(this,e,t);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${t}" instance for host controller "${this.identifier}"`,e)})).filter((t=>t)):[]}},[`${e}OutletElement`]:{get(){const e=this.outlets.find(t),n=this.outlets.getSelectorForOutletName(t);if(e)return e;throw new Error(`Missing outlet element "${t}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(t)}},[`has${u(e)}Outlet`]:{get(){return this.outlets.has(t)}}}}(e))),{})}],ct.targets=[],ct.outlets=[],ct.values={}},3066:(t,e,n)=>{n.d(e,{E:()=>o});var i=n(2891),r=n(5828);function s(t){return t.keys().map((e=>function(t,e){const n=function(t){const e=(t.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(e)return e.replace(/_/g,"-").replace(/\//g,"--")}(e);if(n)return function(t,e){const n=t.default;if("function"==typeof n)return{identifier:e,controllerConstructor:n}}(t(e),n)}(t,e))).filter((t=>t))}function o(t){const e=i.lg.start();t&&e.load(s(t));for(const t in r.A)r.A.hasOwnProperty(t)&&e.register(t,r.A[t]);return e}},5978:(t,e,n)=>{n.d(e,{A:()=>yo});var i=n(2891);function r(){}const s=function(){let t=0;return function(){return t++}}();function o(t){return null==t}function a(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function l(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const c=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function u(t,e){return c(t)?t:e}function h(t,e){return void 0===t?e:t}const d=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function f(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function p(t,e,n,i){let r,s,o;if(a(t))if(s=t.length,i)for(r=s-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;rt,x:t=>t.x,y:t=>t.y};function k(t,e){const n=w[e]||(w[e]=function(t){const e=function(t){const e=t.split("."),n=[];let i="";for(const t of e)i+=t,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}(t);return t=>{for(const n of e){if(""===n)break;t=t&&t[n]}return t}}(e));return n(t)}function S(t){return t.charAt(0).toUpperCase()+t.slice(1)}const E=t=>void 0!==t,O=t=>"function"==typeof t,M=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};const C=Math.PI,A=2*C,T=A+C,P=Number.POSITIVE_INFINITY,L=C/180,D=C/2,N=C/4,I=2*C/3,F=Math.log10,R=Math.sign;function z(t){const e=Math.round(t);t=$(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(F(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function j(t){return!isNaN(parseFloat(t))&&isFinite(t)}function $(t,e,n){return Math.abs(t-e)l&&c=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function J(t,e,n){n=n||(n=>t[n]1;)i=s+r>>1,n(i)?s=i:r=i;return{lo:s,hi:r}}const Z=(t,e,n,i)=>J(t,n,i?i=>t[i][e]<=n:i=>t[i][e]J(t,n,(i=>t[i][e]>=n));const et=["push","pop","shift","splice","unshift"];function nt(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(et.forEach((e=>{delete t[e]})),delete t._chartjs)}function it(t){const e=new Set;let n,i;for(n=0,i=t.length;nArray.prototype.slice.call(t));let r=!1,s=[];return function(...n){s=i(n),r||(r=!0,rt.call(window,(()=>{r=!1,t.apply(e,s)})))}}const ot=t=>"start"===t?"left":"end"===t?"right":"center",at=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function lt(t,e,n){const i=e.length;let r=0,s=i;if(t._sorted){const{iScale:o,_parsed:a}=t,l=o.axis,{min:c,max:u,minDefined:h,maxDefined:d}=o.getUserBounds();h&&(r=X(Math.min(Z(a,o.axis,c).lo,n?i:Z(e,l,o.getPixelForValue(c)).lo),0,i-1)),s=d?X(Math.max(Z(a,o.axis,u,!0).hi+1,n?0:Z(e,l,o.getPixelForValue(u),!0).hi+1),r,i)-r:i-r}return{start:r,count:s}}function ct(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const ut=t=>0===t||1===t,ht=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*A/n),dt=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*A/n)+1,ft={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*D),easeOutSine:t=>Math.sin(t*D),easeInOutSine:t=>-.5*(Math.cos(C*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ut(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ut(t)?t:ht(t,.075,.3),easeOutElastic:t=>ut(t)?t:dt(t,.075,.3),easeInOutElastic(t){const e=.1125;return ut(t)?t:t<.5?.5*ht(2*t,e,.45):.5+.5*dt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ft.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*ft.easeInBounce(2*t):.5*ft.easeOutBounce(2*t-1)+.5};function pt(t){return t+.5|0}const gt=(t,e,n)=>Math.max(Math.min(t,n),e);function mt(t){return gt(pt(2.55*t),0,255)}function bt(t){return gt(pt(255*t),0,255)}function vt(t){return gt(pt(t/2.55)/100,0,1)}function yt(t){return gt(pt(100*t),0,100)}const _t={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},xt=[..."0123456789ABCDEF"],wt=t=>xt[15&t],kt=t=>xt[(240&t)>>4]+xt[15&t],St=t=>(240&t)>>4==(15&t);function Et(t){var e=(t=>St(t.r)&&St(t.g)&&St(t.b)&&St(t.a))(t)?wt:kt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const Ot=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Mt(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function Ct(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function At(t,e,n){const i=Mt(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function Tt(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),s=Math.min(e,n,i),o=(r+s)/2;let a,l,c;return r!==s&&(c=r-s,l=o>.5?c/(2-r-s):c/(r+s),a=function(t,e,n,i,r){return t===r?(e-n)/i+(e>16&255,s>>8&255,255&s]}return t}(),Rt.transparent=[0,0,0,0]);const e=Rt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const jt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const $t=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Bt=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Vt(t,e,n){if(t){let i=Tt(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=Lt(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function Wt(t,e){return t?Object.assign(e||{},t):t}function Ht(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=bt(t[3]))):(e=Wt(t,{r:0,g:0,b:0,a:1})).a=bt(e.a),e}function Ut(t){return"r"===t.charAt(0)?function(t){const e=jt.exec(t);let n,i,r,s=255;if(e){if(e[7]!==n){const t=+e[7];s=e[8]?mt(t):gt(255*t,0,255)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?mt(n):gt(n,0,255)),i=255&(e[4]?mt(i):gt(i,0,255)),r=255&(e[6]?mt(r):gt(r,0,255)),{r:n,g:i,b:r,a:s}}}(t):Nt(t)}class Kt{constructor(t){if(t instanceof Kt)return t;const e=typeof t;let n;var i,r,s;"object"===e?n=Ht(t):"string"===e&&(s=(i=t).length,"#"===i[0]&&(4===s||5===s?r={r:255&17*_t[i[1]],g:255&17*_t[i[2]],b:255&17*_t[i[3]],a:5===s?17*_t[i[4]]:255}:7!==s&&9!==s||(r={r:_t[i[1]]<<4|_t[i[2]],g:_t[i[3]]<<4|_t[i[4]],b:_t[i[5]]<<4|_t[i[6]],a:9===s?_t[i[7]]<<4|_t[i[8]]:255})),n=r||zt(t)||Ut(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Wt(this._rgb);return t&&(t.a=vt(t.a)),t}set rgb(t){this._rgb=Ht(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${vt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?Et(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=Tt(t),n=e[0],i=yt(e[1]),r=yt(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${vt(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,i=t.rgb;let r;const s=e===r?.5:e,o=2*s-1,a=n.a-i.a,l=((o*a==-1?o:(o+a)/(1+o*a))+1)/2;r=1-l,n.r=255&l*n.r+r*i.r+.5,n.g=255&l*n.g+r*i.g+.5,n.b=255&l*n.b+r*i.b+.5,n.a=s*n.a+(1-s)*i.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,n){const i=Bt(vt(t.r)),r=Bt(vt(t.g)),s=Bt(vt(t.b));return{r:bt($t(i+n*(Bt(vt(e.r))-i))),g:bt($t(r+n*(Bt(vt(e.g))-r))),b:bt($t(s+n*(Bt(vt(e.b))-s))),a:t.a+n*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new Kt(this.rgb)}alpha(t){return this._rgb.a=bt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=pt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Vt(this._rgb,2,t),this}darken(t){return Vt(this._rgb,2,-t),this}saturate(t){return Vt(this._rgb,1,t),this}desaturate(t){return Vt(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=Tt(t);n[0]=Dt(n[0]+e),n=Lt(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function Yt(t){return new Kt(t)}function qt(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function Qt(t){return qt(t)?t:Yt(t)}function Xt(t){return qt(t)?t:Yt(t).saturate(.5).darken(.1).hexString()}const Gt=Object.create(null),Jt=Object.create(null);function Zt(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Xt(e.backgroundColor),this.hoverBorderColor=(t,e)=>Xt(e.borderColor),this.hoverColor=(t,e)=>Xt(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return te(this,t,e)}get(t){return Zt(this,t)}describe(t,e){return te(Jt,t,e)}override(t,e){return te(Gt,t,e)}route(t,e,n,i){const r=Zt(this,t),s=Zt(this,n),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=s[i];return l(t)?Object.assign({},e,t):h(t,e)},set(t){this[o]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ne(t,e,n,i,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,n.push(r)),s>i&&(i=s),i}function ie(t,e,n,i){let r=(i=i||{}).data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},s=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let o=0;const l=n.length;let c,u,h,d,f;for(c=0;cn.length){for(c=0;c0&&t.stroke()}}function le(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.xe.top-n&&t.y0&&""!==s.strokeColor;let u,h;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);o(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),u=0;u+t||0;function _e(t,e){const n={},i=l(e),r=i?Object.keys(e):e,s=l(t)?i?n=>h(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=ye(s(t));return n}function xe(t){return _e(t,{top:"y",right:"x",bottom:"y",left:"x"})}function we(t){return _e(t,["topLeft","topRight","bottomLeft","bottomRight"])}function ke(t){const e=xe(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Se(t,e){t=t||{},e=e||ee.font;let n=h(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=h(t.style,e.style);i&&!(""+i).match(be)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const r={family:h(t.family,e.family),lineHeight:ve(h(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:h(t.weight,e.weight),string:""};return r.string=function(t){return!t||o(t.size)||o(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function Ee(t,e,n,i){let r,s,o,l=!0;for(r=0,s=t.length;rt[0])){E(i)||(i=ze("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:i,_getTarget:r,override:r=>Me([r,...t],e,n,i)};return new Proxy(s,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>Le(n,i,(()=>function(t,e,n,i){let r;for(const s of e)if(r=ze(Te(s,t),n),E(r))return Pe(t,r)?Fe(n,i,t,r):r}(i,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>je(t).includes(e),ownKeys:t=>je(t),set(t,e,n){const i=t._storage||(t._storage=r());return t[e]=i[e]=n,delete t._keys,!0}})}function Ce(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Ae(t,i),setContext:e=>Ce(t,e,n,i),override:r=>Ce(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Le(t,e,(()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:o}=t;let c=i[e];O(c)&&o.isScriptable(e)&&(c=function(t,e,n,i){const{_proxy:r,_context:s,_subProxy:o,_stack:a}=n;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t),e=e(s,o||i),a.delete(t),Pe(t,e)&&(e=Fe(r._scopes,r,t,e));return e}(e,c,t,n));a(c)&&c.length&&(c=function(t,e,n,i){const{_proxy:r,_context:s,_subProxy:o,_descriptors:a}=n;if(E(s.index)&&i(t))e=e[s.index%e.length];else if(l(e[0])){const n=e,i=r._scopes.filter((t=>t!==n));e=[];for(const l of n){const n=Fe(i,r,t,l);e.push(Ce(n,s,o&&o[t],a))}}return e}(e,c,t,o.isIndexable));Pe(e,c)&&(c=Ce(c,r,s&&s[e],o));return c}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function Ae(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:O(n)?n:()=>n,isIndexable:O(i)?i:()=>i}}const Te=(t,e)=>t?t+S(e):e,Pe=(t,e)=>l(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Le(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function De(t,e,n){return O(t)?t(e,n):t}const Ne=(t,e)=>!0===t?e:"string"==typeof t?k(e,t):void 0;function Ie(t,e,n,i,r){for(const s of e){const e=Ne(n,s);if(e){t.add(e);const s=De(e._fallback,n,r);if(E(s)&&s!==n&&s!==i)return s}else if(!1===e&&E(i)&&n!==i)return null}return!1}function Fe(t,e,n,i){const r=e._rootScopes,s=De(e._fallback,n,i),o=[...t,...r],c=new Set;c.add(i);let u=Re(c,o,n,s||n,i);return null!==u&&((!E(s)||s===n||(u=Re(c,o,s,u,i),null!==u))&&Me(Array.from(c),[""],r,s,(()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];if(a(r)&&l(n))return n;return r}(e,n,i))))}function Re(t,e,n,i,r){for(;n;)n=Ie(t,e,n,i,r);return n}function ze(t,e){for(const n of e){if(!n)continue;const e=n[t];if(E(e))return e}}function je(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function $e(t,e,n,i){const{iScale:r}=t,{key:s="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;ae"x"===t?"y":"x";function He(t,e,n,i){const r=t.skip?e:t,s=e,o=n.skip?e:n,a=K(s,r),l=K(o,s);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,d=i*u;return{previous:{x:s.x-h*(o.x-r.x),y:s.y-h*(o.y-r.y)},next:{x:s.x+d*(o.x-r.x),y:s.y+d*(o.y-r.y)}}}function Ue(t,e="x"){const n=We(e),i=t.length,r=Array(i).fill(0),s=Array(i);let o,a,l,c=Ve(t,0);for(o=0;o!t.skip))),"monotone"===e.cubicInterpolationMode)Ue(t,r);else{let n=i?t[t.length-1]:t[0];for(s=0,o=t.length;swindow.getComputedStyle(t,null);const Je=["top","right","bottom","left"];function Ze(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=Je[r];i[s]=parseFloat(t[e+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const tn=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function en(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,r=Ge(n),s="border-box"===r.boxSizing,o=Ze(r,"padding"),a=Ze(r,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:r,offsetY:s}=i;let o,a,l=!1;if(tn(r,s,t.target))o=r,a=s;else{const t=e.getBoundingClientRect();o=i.clientX-t.left,a=i.clientY-t.top,l=!0}return{x:o,y:a,box:l}}(t,n),h=o.left+(u&&a.left),d=o.top+(u&&a.top);let{width:f,height:p}=e;return s&&(f-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-h)/f*n.width/i),y:Math.round((c-d)/p*n.height/i)}}const nn=t=>Math.round(10*t)/10;function rn(t,e,n,i){const r=Ge(t),s=Ze(r,"margin"),o=Xe(r.maxWidth,t,"clientWidth")||P,a=Xe(r.maxHeight,t,"clientHeight")||P,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const s=Qe(t);if(s){const t=s.getBoundingClientRect(),o=Ge(s),a=Ze(o,"border","width"),l=Ze(o,"padding");e=t.width-l.width-a.width,n=t.height-l.height-a.height,i=Xe(o.maxWidth,s,"clientWidth"),r=Xe(o.maxHeight,s,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||P,maxHeight:r||P}}(t,e,n);let{width:c,height:u}=l;if("content-box"===r.boxSizing){const t=Ze(r,"border","width"),e=Ze(r,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-s.width),u=Math.max(0,i?Math.floor(c/i):u-s.height),c=nn(Math.min(c,o,l.maxWidth)),u=nn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=nn(c/2)),{width:c,height:u}}function sn(t,e,n){const i=e||1,r=Math.floor(t.height*i),s=Math.floor(t.width*i);t.height=r/i,t.width=s/i;const o=t.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||o.height!==r||o.width!==s)&&(t.currentDevicePixelRatio=i,o.height=r,o.width=s,t.ctx.setTransform(i,0,0,i,0,0),!0)}const on=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function an(t,e){const n=function(t,e){return Ge(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ln(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function cn(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function un(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},o=ln(t,r,n),a=ln(r,s,n),l=ln(s,e,n),c=ln(o,a,n),u=ln(a,l,n);return ln(c,u,n)}const hn=new Map;function dn(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=hn.get(n);return i||(i=new Intl.NumberFormat(t,e),hn.set(n,i)),i}(e,n).format(t)}function fn(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function pn(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function gn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function mn(t){return"angle"===t?{between:Q,compare:Y,normalize:q}:{between:G,compare:(t,e)=>t-e,normalize:t=>t}}function bn({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function vn(t,e,n){if(!n)return[t];const{property:i,start:r,end:s}=n,o=e.length,{compare:a,between:l,normalize:c}=mn(i),{start:u,end:h,loop:d,style:f}=function(t,e,n){const{property:i,start:r,end:s}=n,{between:o,normalize:a}=mn(i),l=e.length;let c,u,{start:h,end:d,loop:f}=t;if(f){for(h+=l,d+=l,c=0,u=l;cv||l(r,b,g)&&0!==a(r,b),x=()=>!v||0===a(s,g)||l(s,b,g);for(let t=u,n=u;t<=h;++t)m=e[t%o],m.skip||(g=c(m[i]),g!==b&&(v=l(g,r,s),null===y&&_()&&(y=0===a(g,r)?t:n),null!==y&&x()&&(p.push(bn({start:y,end:t,loop:d,count:o,style:f})),y=null),n=t,b=g));return null!==y&&p.push(bn({start:y,end:h,loop:d,count:o,style:f})),p}function yn(t,e){const n=[],i=t.segments;for(let r=0;ri({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(n-e.start,s)})))}_refresh(){this._request||(this._running=!0,this._request=rt.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let s,o=r.length-1,a=!1;for(;o>=0;--o)s=r[o],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const Sn="transparent",En={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=Qt(t||Sn),r=i.valid&&Qt(e||Sn);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class On{constructor(t,e,n,i){const r=e[n];i=Ee([t.to,i,r,t.from]);const s=Ee([t.from,r,i]);this._active=!0,this._fn=t.fn||En[t.type||typeof s],this._easing=ft[t.easing]||ft.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,s=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Ee([t.to,e,i,t.from]),this._from=Ee([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,s=this._loop,o=this._to;let a;if(this._active=r!==o&&(s||e1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[i]=this._fn(r,o,a))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ee.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ee.describe("animations",{_fallback:"animation"}),ee.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class Cn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!l(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const i=t[n];if(!l(i))return;const r={};for(const t of Mn)r[t]=i[t];(a(i.properties)&&i.properties||[n]).forEach((t=>{t!==n&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e{t.options=n}),(()=>{})),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let a;for(a=s.length-1;a>=0;--a){const l=s[a];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let u=r[l];const h=n.get(l);if(u){if(h&&u.active()){u.update(h,c,o);continue}u.cancel()}h&&h.duration?(r[l]=u=new On(h,t,l,c),i.push(u)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(kn.add(this._chart,n),!0):void 0}}function An(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,s=void 0===n.max?e:0;return{start:i?s:r,end:i?r:s}}function Tn(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=i.length;r0||!n&&e<0)return r.index}return null}function In(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=i,l=s.axis,c=o.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(s,o,i),h=e.length;let d;for(let t=0;tn[t].axis===e)).shift()}function Rn(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n]}}}const zn=t=>"reset"===t||"none"===t,jn=(t,e)=>e?t:Object.assign({},t);class $n{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ln(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Rn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,r=e.xAxisID=h(n.xAxisID,Fn(t,"x")),s=e.yAxisID=h(n.yAxisID,Fn(t,"y")),o=e.rAxisID=h(n.rAxisID,Fn(t,"r")),a=e.indexAxis,l=e.iAxisID=i(a,r,s,o),c=e.vAxisID=i(a,s,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&nt(this._data,this),t._stacked&&Rn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(l(e))this._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,r,s;for(i=0,r=e.length;i{const e="_onData"+S(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const r=n.apply(this,t);return i._chartjs.listeners.forEach((n=>{"function"==typeof n[e]&&n[e](...t)})),r}})})))),this._syncList=[],this._data=e}var i,r}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=Ln(e.vScale,e),e.stack!==n.stack&&(i=!0,Rn(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&In(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:s}=n,o=r.axis;let c,u,h,d=0===t&&e===i.length||n._sorted,f=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,h=i;else{h=a(i[t])?this.parseArrayData(n,i,t,e):l(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const r=()=>null===u[o]||f&&u[o]t&&!e.hidden&&e._stacked&&{keys:Tn(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(o);let d,f;function p(){f=i[d];const e=f[o.axis];return!c(f[t.axis])||u>e||h=0;--d)if(!p()){this.updateRangeFromParsed(l,t,f,a);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,s;for(i=0,r=e.length;i=0&&tthis.getContext(n,i)),u);return f.$shared&&(f.$shared=a,r[s]=Object.freeze(jn(f,a))),f}_resolveAnimations(t,e,n){const i=this.chart,r=this._cachedDataOpts,s=`animation-${e}`,o=r[s];if(o)return o;let a;if(!1!==i.options.animation){const i=this.chart.config,r=i.datasetAnimationScopeKeys(this._type,e),s=i.getOptionScopes(this.getDataset(),r);a=i.createResolver(s,this.getContext(t,n,e))}const l=new Cn(i,a&&a.animations);return a&&a._cacheable&&(r[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||zn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),i=this._sharedOptions,r=this.getSharedOptions(n),s=this.includeOptions(e,r)||r!==i;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:s}}updateElement(t,e,n,i){zn(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!zn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const i=n.length,r=e.length,s=Math.min(r,i);s&&this.parse(0,s),r>i?this._insertElements(i,r-i,t):r{for(t.length+=e,o=t.length-1;o>=s;o--)t[o]=t[o-e]};for(a(r),o=t;ot-e)))}return t._cache.$bar}(e,t.type);let i,r,s,o,a=e._length;const l=()=>{32767!==s&&-32768!==s&&(E(o)&&(a=Math.min(a,Math.abs(s-o)||a)),o=s)};for(i=0,r=n.length;iMath.abs(a)&&(l=a,c=o),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:s,min:o,max:a}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Wn(t,e,n,i){const r=t.iScale,s=t.vScale,o=r.getLabels(),a=r===s,l=[];let c,u,h,d;for(c=n,u=n+i;ct.x,n="left",i="right"):(e=t.baset.controller.options.grouped)),r=n.options.stacked,s=[],a=t=>{const n=t.controller.getParsed(e),i=n&&n[t.vScale.axis];if(o(i)||isNaN(i))return!0};for(const n of i)if((void 0===e||!a(n))&&((!1===r||-1===s.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&s.push(n.stack),n.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),r=void 0!==e?i.indexOf(e):-1;return-1===r?i.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let r,s;for(r=0,s=e.data.length;r=n?1:-1)}(h,e,s)*r,d===s&&(m-=h/2);const t=e.getPixelForDecimal(0),n=e.getPixelForDecimal(1),i=Math.min(t,n),o=Math.max(t,n);m=Math.max(Math.min(m,o),i),u=m+h}if(m===e.getPixelForValue(s)){const t=R(h)*e.getLineWidthForValue(s)/2;m+=t,h-=t}return{size:h,base:m,head:u,center:u+h/2}}_calculateBarIndexPixels(t,e){const n=e.scale,i=this.options,r=i.skipNull,s=h(i.maxBarThickness,1/0);let a,l;if(e.grouped){const n=r?this._getStackCount(t):e.stackCount,c="flex"===i.barThickness?function(t,e,n,i){const r=e.pixels,s=r[t];let o=t>0?r[t-1]:null,a=t=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,r=this.getParsed(t),s=n.getLabelForValue(r.x),o=i.getLabelForValue(r.y),a=r._custom;return{label:e.label,value:"("+s+", "+o+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:a,includeOptions:l}=this._getSharedOptions(e,i),c=s.axis,u=o.axis;for(let h=e;h""}}}};class Gn extends $n{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let r,s,o=t=>+n[t];if(l(n[t])){const{key:t="value"}=this._parsing;o=e=>+k(n[e],t)}for(r=t,s=t+e;rQ(t,a,l,!0)?1:Math.max(e,e*n,i,i*n),p=(t,e,i)=>Q(t,a,l,!0)?-1:Math.min(e,e*n,i,i*n),g=f(0,c,h),m=f(D,u,d),b=p(C,c,h),v=p(C+D,u,d);i=(g-b)/2,r=(m-v)/2,s=-(g+b)/2,o=-(m+v)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:o}}(f,h,a),v=(n.width-s)/p,y=(n.height-s)/g,_=Math.max(Math.min(v,y)/2,0),x=d(this.options.radius,_),w=(x-Math.max(x*a,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=b*x,i.total=this.calculateTotal(),this.outerRadius=x-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*u,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/A)}updateElements(t,e,n,i){const r="reset"===i,s=this.chart,o=s.chartArea,a=s.options.animation,l=(o.left+o.right)/2,c=(o.top+o.bottom)/2,u=r&&a.animateScale,h=u?0:this.innerRadius,d=u?0:this.outerRadius,{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,i);let g,m=this._getRotation();for(g=0;g0&&!isNaN(t)?A*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=dn(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,s,o,a;if(!t)for(i=0,r=n.data.datasets.length;i"spacing"!==t,_indexable:t=>"spacing"!==t},Gn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return a(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class Jn extends $n{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=lt(e,i,s);this._drawStart=o,this._drawCount=a,ct(e)&&(o=0,a=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!s,options:l},t),this.updateElements(i,o,a,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,i),d=s.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=j(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||r||"none"===i;let v=e>0&&this.getParsed(e-1);for(let p=e;p0&&Math.abs(n[d]-v[d])>m,g&&(y.parsed=n,y.raw=c.data[p]),h&&(y.options=u||this.resolveDataElementOptions(p,e.active?"active":i)),b||this.updateElement(e,p,y,i),v=n}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Jn.id="line",Jn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Jn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Zn extends $n{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=dn(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}parseObjectData(t,e,n,i){return $e.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,n)=>{const i=this.getParsed(n).r;!isNaN(i)&&this.chart.getDataVisibility(n)&&(ie.max&&(e.max=i))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(i/2,0),s=(r-Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,n,i){const r="reset"===i,s=this.chart,o=s.options.animation,a=this._cachedMeta.rScale,l=a.xCenter,c=a.yCenter,u=a.getIndexAngle(0)-.5*C;let h,d=u;const f=360/this.countVisibleElements();for(h=0;h{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++})),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?V(this.resolveDataElementOptions(t,e).angle||n):0}}Zn.id="polarArea",Zn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Zn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class ti extends Gn{}ti.id="pie",ti.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class ei extends $n{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,i){return $e.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],r=e.iScale.getLabels();if(n.points=i,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:r.length===i.length,options:e};this.updateElement(n,void 0,s,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const r=this._cachedMeta.rScale,s="reset"===i;for(let o=e;o{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]})),i}}ni.defaults={},ni.defaultRoutes=void 0;const ii={values:t=>a(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,s=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),s=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}const o=F(Math.abs(s)),a=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:r,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),dn(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(F(t)));return 1===i||2===i||5===i?ii.numeric.call(this,t,e,n):""}};var ri={formatters:ii};function si(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;ni)return function(t,e,n,i){let r,s=0,o=n[0];for(i=Math.ceil(i),r=0;rt-e)).pop(),e}(i);for(let t=0,e=s.length-1;tr)return e}return Math.max(r,1)}(r,e,i);if(s>0){let t,n;const i=s>1?Math.round((l-a)/(s-1)):null;for(oi(e,c,u,o(i)?0:a-i,a),t=0,n=s-1;te.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ri.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ee.route("scale.ticks","color","","color"),ee.route("scale.grid","color","","borderColor"),ee.route("scale.grid","borderColor","","borderColor"),ee.route("scale.title","color","","color"),ee.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ee.describe("scales",{_fallback:"scale"}),ee.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const ai=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function li(t,e){const n=[],i=t.length/e,r=t.length;let s=0;for(;so+a)))return c}function ui(t){return t.drawTicks?t.tickLength:0}function hi(t,e){if(!t.display)return 0;const n=Se(t.font,e),i=ke(t.padding);return(a(t.text)?t.text.length:1)*n.lineHeight+i.height}function di(t,e,n){let i=ot(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class fi extends ni{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=u(t,Number.POSITIVE_INFINITY),e=u(e,Number.NEGATIVE_INFINITY),n=u(n,Number.POSITIVE_INFINITY),i=u(i,Number.NEGATIVE_INFINITY),{min:u(t,n),max:u(e,i),minDefined:c(t),maxDefined:c(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds();if(r&&s)return{min:n,max:i};const o=this.getMatchingVisibleMetas();for(let a=0,l=o.length;ai?i:n,i=r&&n>i?n:i,{min:u(n,u(i,n)),max:u(i,u(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){f(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:r,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,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=function(t,e,n){const{min:i,max:r}=t,s=d(e,(r-i)/2),o=(t,e)=>n&&0===t?0:t+e;return{min:o(i,-Math.abs(s)),max:o(r,s)}}(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=o=r||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),u=c.widest.width,h=c.highest.height,d=X(this.chart.width-u,0,this.maxWidth);s=t.offset?this.maxWidth/n:d/(n-1),u+6>s&&(s=d/(n-(t.offset?.5:1)),o=this.maxHeight-ui(t.grid)-e.padding-hi(t.title,this.chart.options.font),a=Math.sqrt(u*u+h*h),l=W(Math.min(Math.asin(X((c.highest.height+6)/s,-1,1)),Math.asin(X(o/a,-1,1))-Math.asin(X(h/a,-1,1)))),l=Math.max(i,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){f(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){f(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:r}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const s=hi(i,e.options.font);if(o?(t.width=this.maxWidth,t.height=ui(r)+s):(t.height=this.maxHeight,t.width=ui(r)+s),n.display&&this.ticks.length){const{first:e,last:i,widest:r,highest:s}=this._getLabelSizes(),a=2*n.padding,l=V(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(o){const e=n.mirror?0:u*r.width+c*s.height;t.height=Math.min(this.maxHeight,t.height+e+a)}else{const e=n.mirror?0:c*r.width+u*s.height;t.width=Math.min(this.maxWidth,t.width+e+a)}this._calculatePadding(e,i,u,c)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:r,padding:s},position:o}=this.options,a=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,h=0;a?l?(u=i*t.width,h=n*e.height):(u=n*t.height,h=i*e.width):"start"===r?h=e.width:"end"===r?u=t.width:"inner"!==r&&(u=t.width/2,h=e.width/2),this.paddingLeft=Math.max((u-o+s)*this.width/(this.width-o),0),this.paddingRight=Math.max((h-c+s)*this.width/(this.width-c),0)}else{let n=e.height/2,i=t.height/2;"start"===r?(n=0,i=t.height):"end"===r&&(n=e.height,i=0),this.paddingTop=n+s,this.paddingBottom=i+s}}_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(){f(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e{const n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r({width:r[t]||0,height:s[t]||0});return{first:S(0),last:S(e-1),widest:S(w),highest:S(k),widths:r,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return X(this._alignToPixels?re(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&to*i?o/n:a/i:a*i0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:r,position:s}=i,o=r.offset,a=this.isHorizontal(),c=this.ticks.length+(o?1:0),u=ui(r),d=[],f=r.setContext(this.getContext()),p=f.drawBorder?f.borderWidth:0,g=p/2,m=function(t){return re(n,t,p)};let b,v,y,_,x,w,k,S,E,O,M,C;if("top"===s)b=m(this.bottom),w=this.bottom-u,S=b-g,O=m(t.top)+g,C=t.bottom;else if("bottom"===s)b=m(this.top),O=t.top,C=m(t.bottom)-g,w=b+g,S=this.top+u;else if("left"===s)b=m(this.right),x=this.right-u,k=b-g,E=m(t.left)+g,M=t.right;else if("right"===s)b=m(this.left),E=t.left,M=m(t.right)-g,x=b+g,k=this.left+u;else if("x"===e){if("center"===s)b=m((t.top+t.bottom)/2+.5);else if(l(s)){const t=Object.keys(s)[0],e=s[t];b=m(this.chart.scales[t].getPixelForValue(e))}O=t.top,C=t.bottom,w=b+g,S=w+u}else if("y"===e){if("center"===s)b=m((t.left+t.right)/2);else if(l(s)){const t=Object.keys(s)[0],e=s[t];b=m(this.chart.scales[t].getPixelForValue(e))}x=b-g,k=x-u,E=t.left,M=t.right}const A=h(i.ticks.maxTicksLimit,c),T=Math.max(1,Math.ceil(c/A));for(v=0;ve.value===t));if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,s;const o=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(r=0,s=i.length;r{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,s;for(r=0,s=e.length;r{const i=n.split("."),r=i.pop(),s=[t].concat(i).join("."),o=e[n].split("."),a=o.pop(),l=o.join(".");ee.route(s,r,l,a)}))}(e,t.defaultRoutes);t.descriptors&&ee.describe(e,t.descriptors)}(t,s,n),this.override&&ee.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in ee[i]&&(delete ee[i][n],this.override&&delete Gt[n])}}var gi=new class{constructor(){this.controllers=new pi($n,"datasets",!0),this.elements=new pi(ni,"elements"),this.plugins=new pi(Object,"plugins"),this.scales=new pi(fi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach((e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):p(e,(e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)}))}))}_exec(t,e,n){const i=S(t);f(n["before"+i],[],n),e[t](n),f(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let u=e;u0&&Math.abs(n[f]-y[f])>b,m&&(g.parsed=n,g.raw=c.data[u]),d&&(g.options=h||this.resolveDataElementOptions(u,e.active?"active":i)),v||this.updateElement(e,u,g,i),y=n}this.updateSharedOptions(h,i,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}const n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!e.length)return i;const r=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,r,s)/2}}mi.id="scatter",mi.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},mi.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var bi=Object.freeze({__proto__:null,BarController:Qn,BubbleController:Xn,DoughnutController:Gn,LineController:Jn,PolarAreaController:Zn,PieController:ti,RadarController:ei,ScatterController:mi});function vi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class yi{constructor(t){this.options=t||{}}init(t){}formats(){return vi()}parse(t,e){return vi()}format(t,e){return vi()}add(t,e,n){return vi()}diff(t,e,n){return vi()}startOf(t,e,n){return vi()}endOf(t,e){return vi()}}yi.override=function(t){Object.assign(yi.prototype,t)};var _i={_date:yi};function xi(t,e,n,i){const{controller:r,data:s,_sorted:o}=t,a=r._cachedMeta.iScale;if(a&&e===a.axis&&"r"!==e&&o&&s.length){const t=a._reversePixels?tt:Z;if(!i)return t(s,e,n);if(r._sharedOptions){const i=s[0],r="function"==typeof i.getRange&&i.getRange(e);if(r){const i=t(s,e,n-r),o=t(s,e,n+r);return{lo:i.lo,hi:o.hi}}}}return{lo:0,hi:s.length-1}}function wi(t,e,n,i,r){const s=t.getSortedVisibleDatasetMetas(),o=n[e];for(let t=0,n=s.length;t{t[o](e[n],r)&&(s.push({element:t,datasetIndex:i,index:l}),a=a||t.inRange(e.x,e.y,r))})),i&&!a?[]:s}var Mi={evaluateInteractionItems:wi,modes:{index(t,e,n,i){const r=en(e,t),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?ki(t,r,s,i,o):Ei(t,r,s,!1,i,o),l=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&l.push({element:n,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,n,i){const r=en(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?ki(t,r,s,i,o):Ei(t,r,s,!1,i,o);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;tki(t,en(e,t),n.axis||"xy",i,n.includeInvisible||!1),nearest(t,e,n,i){const r=en(e,t),s=n.axis||"xy",o=n.includeInvisible||!1;return Ei(t,r,s,n.intersect,i,o)},x:(t,e,n,i)=>Oi(t,en(e,t),"x",n.intersect,i),y:(t,e,n,i)=>Oi(t,en(e,t),"y",n.intersect,i)}};const Ci=["left","top","right","bottom"];function Ai(t,e){return t.filter((t=>t.pos===e))}function Ti(t,e){return t.filter((t=>-1===Ci.indexOf(t.pos)&&t.box.axis===e))}function Pi(t,e){return t.sort(((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function Li(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!Ci.includes(i))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=r}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let s,o,a;for(s=0,o=t.length;s{i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function Ri(t,e,n,i){const r=[];let s,o,a,l,c,u;for(s=0,o=t.length,c=0;st.box.fullSize)),!0),i=Pi(Ai(e,"left"),!0),r=Pi(Ai(e,"right")),s=Pi(Ai(e,"top"),!0),o=Pi(Ai(e,"bottom")),a=Ti(e,"x"),l=Ti(e,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(l).concat(o).concat(a),chartArea:Ai(e,"chartArea"),vertical:i.concat(r).concat(l),horizontal:s.concat(o).concat(a)}}(t.boxes),l=a.vertical,c=a.horizontal;p(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const u=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),d=Object.assign({},r);Ni(d,ke(i));const f=Object.assign({maxPadding:d,w:s,h:o,x:r.left,y:r.top},r),g=Li(l.concat(c),h);Ri(a.fullSize,f,h,g),Ri(l,f,h,g),Ri(c,f,h,g)&&Ri(l,f,h,g),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(f),ji(a.leftAndTop,f,h,g),f.x+=f.w,f.y+=f.h,ji(a.rightAndBottom,f,h,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},p(a.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Bi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Vi extends Bi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Wi="$chartjs",Hi={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ui=t=>null===t||""===t;const Ki=!!on&&{passive:!0};function Yi(t,e,n){t.canvas.removeEventListener(e,n,Ki)}function qi(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Qi(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||qi(n.addedNodes,i),e=e&&!qi(n.removedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}function Xi(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||qi(n.removedNodes,i),e=e&&!qi(n.addedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}const Gi=new Map;let Ji=0;function Zi(){const t=window.devicePixelRatio;t!==Ji&&(Ji=t,Gi.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function tr(t,e,n){const i=t.canvas,r=i&&Qe(i);if(!r)return;const s=st(((t,e)=>{const i=r.clientWidth;n(t,e),i{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||s(n,i)}));return o.observe(r),function(t,e){Gi.size||window.addEventListener("resize",Zi),Gi.set(t,e)}(t,s),o}function er(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Gi.delete(t),Gi.size||window.removeEventListener("resize",Zi)}(t)}function nr(t,e,n){const i=t.canvas,r=st((e=>{null!==t.ctx&&n(function(t,e){const n=Hi[t.type]||t.type,{x:i,y:r}=en(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,n){t.addEventListener(e,n,Ki)}(i,e,r),r}class ir extends Bi{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t[Wi]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ui(r)){const e=an(t,"width");void 0!==e&&(t.width=e)}if(Ui(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=an(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Wi])return!1;const n=e[Wi].initial;["height","width"].forEach((t=>{const i=n[t];o(i)?e.removeAttribute(t):e.setAttribute(t,i)}));const i=n.style||{};return Object.keys(i).forEach((t=>{e.style[t]=i[t]})),e.width=e.width,delete e[Wi],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:Qi,detach:Xi,resize:tr}[e]||nr;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];if(!i)return;({attach:er,detach:er,resize:er}[e]||Yi)(t,e,i),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return rn(t,e,n,i)}isAttached(t){const e=Qe(t);return!(!e||!e.isConnected)}}class rr{constructor(){this._init=[]}notify(t,e,n,i){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(r,t,e,n);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===f(t[n],[e,i,r.options],t)&&i.cancelable)return!1}return!0}invalidate(){o(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=h(n.options&&n.options.plugins,{}),r=function(t){const e={},n=[],i=Object.keys(gi.plugins.items);for(let t=0;tt.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function sr(t,e){return e||!1!==t?!0===t?{}:t:null}function or(t,{plugin:e,local:n},i,r){const s=t.pluginScopeKeys(e),o=t.getOptionScopes(i,s);return n&&e.defaults&&o.push(e.defaults),t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ar(t,e){const n=ee.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function lr(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function cr(t){const e=t.options||(t.options={});e.plugins=h(e.plugins,{}),e.scales=function(t,e){const n=Gt[t.type]||{scales:{}},i=e.scales||{},r=ar(t.type,e),s=Object.create(null),o=Object.create(null);return Object.keys(i).forEach((t=>{const e=i[t];if(!l(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const a=lr(t,e),c=function(t,e){return t===e?"_index_":"_value_"}(a,r),u=n.scales||{};s[a]=s[a]||t,o[t]=_(Object.create(null),[{axis:a},e,u[a],u[c]])})),t.data.datasets.forEach((n=>{const r=n.type||t.type,a=n.indexAxis||ar(r,e),l=(Gt[r]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,a),r=n[e+"AxisID"]||s[e]||e;o[r]=o[r]||Object.create(null),_(o[r],[{axis:e},i[r],l[t]])}))})),Object.keys(o).forEach((t=>{const e=o[t];_(e,[ee.scales[e.type],ee.scale])})),o}(t,e)}function ur(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const hr=new Map,dr=new Set;function fr(t,e){let n=hr.get(t);return n||(n=e(),hr.set(t,n),dr.add(n)),n}const pr=(t,e,n)=>{const i=k(e,n);void 0!==i&&t.add(i)};class gr{constructor(t){this._config=function(t){return(t=t||{}).data=ur(t.data),cr(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=ur(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),cr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return fr(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return fr(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return fr(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return fr(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,s=this._cachedScopes(t,n),o=s.get(e);if(o)return o;const a=new Set;e.forEach((e=>{t&&(a.add(t),e.forEach((e=>pr(a,t,e)))),e.forEach((t=>pr(a,i,t))),e.forEach((t=>pr(a,Gt[r]||{},t))),e.forEach((t=>pr(a,ee,t))),e.forEach((t=>pr(a,Jt,t)))}));const l=Array.from(a);return 0===l.length&&l.push(Object.create(null)),dr.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Gt[e]||{},ee.datasets[e]||{},{type:e},ee,Jt]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:s,subPrefixes:o}=mr(this._resolverCache,t,i);let l=s;if(function(t,e){const{isScriptable:n,isIndexable:i}=Ae(t);for(const r of e){const e=n(r),s=i(r),o=(s||e)&&t[r];if(e&&(O(o)||br(o))||s&&a(o))return!0}return!1}(s,e)){r.$shared=!1;l=Ce(s,n=O(n)?n():n,this.createResolver(t,n,o))}for(const t of e)r[t]=l[t];return r}createResolver(t,e,n=[""],i){const{resolver:r}=mr(this._resolverCache,t,n);return l(e)?Ce(r,e,void 0,i):r}}function mr(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let s=i.get(r);if(!s){s={resolver:Me(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},i.set(r,s)}return s}const br=t=>l(t)&&Object.getOwnPropertyNames(t).reduce(((e,n)=>e||O(t[n])),!1);const vr=["top","bottom","left","right","chartArea"];function yr(t,e){return"top"===t||"bottom"===t||-1===vr.indexOf(t)&&"x"===e}function _r(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function xr(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),f(n&&n.onComplete,[t],e)}function wr(t){const e=t.chart,n=e.options.animation;f(n&&n.onProgress,[t],e)}function kr(t){return qe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Sr={},Er=t=>{const e=kr(t);return Object.values(Sr).filter((t=>t.canvas===e)).pop()};function Or(t,e,n){const i=Object.keys(t);for(const r of i){const i=+r;if(i>=e){const s=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=s)}}}class Mr{constructor(t,e){const n=this.config=new gr(e),i=kr(t),r=Er(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!qe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Vi:ir}(i)),this.platform.updateConfig(n);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;this.id=s(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,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 rr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],Sr[this.id]=this,a&&l?(kn.listen(this,"complete",xr),kn.listen(this,"progress",wr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return o(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return se(this.canvas,this.ctx),this}stop(){return kn.stop(this),this}resize(t,e){kn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,e,r),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,sn(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),f(n.onResize,[this,s],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){p(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const n=e[t],i=lr(t,n),r="r"===i,s="x"===i;return{options:n,dposition:r?"chartArea":s?"bottom":"left",dtype:r?"radialLinear":s?"category":"linear"}})))),p(r,(e=>{const r=e.options,s=r.id,o=lr(s,r),a=h(r.type,e.dtype);void 0!==r.position&&yr(r.position,o)===yr(e.dposition)||(r.position=e.dposition),i[s]=!0;let l=null;if(s in n&&n[s].type===a)l=n[s];else{l=new(gi.getScale(a))({id:s,type:a,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(r,t)})),p(i,((t,e)=>{t||delete n[e]})),p(n,(t=>{$i.configure(this,t,t.options),$i.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort(((t,e)=>t.index-e.index)),n>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,n)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(_r("z","_idx"));const{_active:o,_lastEvent:a}=this;a?this._eventHandler(a,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){p(this.scales,(t=>{$i.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);M(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of e){Or(t,i,"_removeElements"===n?-r:r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),i=n(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;$i.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],p(this.boxes,(t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,i=!n.disabled,r=this.chartArea,s={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",s)&&(i&&ce(e,{left:!1===n.left?0:r.left-n.left,right:!1===n.right?this.width:r.right+n.right,top:!1===n.top?0:r.top-n.top,bottom:!1===n.bottom?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&ue(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return le(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,i){const r=Mi.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter((t=>t&&t._dataset===e)).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=Oe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),s=r.controller._resolveAnimations(void 0,i);E(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),s.update(r,{visible:n}),this.update((e=>e.datasetIndex===t?i:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),kn.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};p(this.options.events,(t=>n(t,i)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const o=()=>{i("attach",o),this.attached=!0,this.resize(),n("resize",r),n("detach",s)};s=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){p(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},p(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,s,o,a;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),o=0,a=t.length;o{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}));!g(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),s=r(e,t),o=n?t:r(t,e);s.length&&this.updateHoverStyle(s,i.mode,!1),o.length&&i.mode&&this.updateHoverStyle(o,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:r}=this,s=e,o=this._getActiveElements(t,i,n,s),a=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,i){return n&&"mouseout"!==t.type?i?e:t:null}(t,this._lastEvent,n,a);n&&(this._lastEvent=null,f(r.onHover,[t,o,this],this),a&&f(r.onClick,[t,o,this],this));const c=!g(o,i);return(c||e)&&(this._active=o,this._updateHoverStyles(o,i,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,i){if("mouseout"===t.type)return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}}const Cr=()=>p(Mr.instances,(t=>t._plugins.invalidate())),Ar=!0;function Tr(t,e,n){const{startAngle:i,pixelMargin:r,x:s,y:o,outerRadius:a,innerRadius:l}=e;let c=r/a;t.beginPath(),t.arc(s,o,a,i-c,n+c),l>r?(c=r/l,t.arc(s,o,l,n+c,i-c,!0)):t.arc(s,o,r,n+D,i-D),t.closePath(),t.clip()}function Pr(t,e,n,i){const r=_e(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(n-e)/2,o=Math.min(s,i*e/2),a=t=>{const e=(n-Math.min(s,t))*i/2;return X(t,0,Math.min(s,e))};return{outerStart:a(r.outerStart),outerEnd:a(r.outerEnd),innerStart:X(r.innerStart,0,o),innerEnd:X(r.innerEnd,0,o)}}function Lr(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function Dr(t,e,n,i,r,s){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=e,h=Math.max(e.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0;let f=0;const p=r-l;if(i){const t=((u>0?u-i:0)+(h>0?h-i:0))/2;f=(p-(0!==t?p*t/(t+i):p))/2}const g=(p-Math.max(.001,p*h-n/C)/h)/2,m=l+g+f,b=r-g-f,{outerStart:v,outerEnd:y,innerStart:_,innerEnd:x}=Pr(e,d,h,b-m),w=h-v,k=h-y,S=m+v/w,E=b-y/k,O=d+_,M=d+x,A=m+_/O,T=b-x/M;if(t.beginPath(),s){if(t.arc(o,a,h,S,E),y>0){const e=Lr(k,E,o,a);t.arc(e.x,e.y,y,E,b+D)}const e=Lr(M,b,o,a);if(t.lineTo(e.x,e.y),x>0){const e=Lr(M,T,o,a);t.arc(e.x,e.y,x,b+D,T+Math.PI)}if(t.arc(o,a,d,b-x/d,m+_/d,!0),_>0){const e=Lr(O,A,o,a);t.arc(e.x,e.y,_,A+Math.PI,m-D)}const n=Lr(w,m,o,a);if(t.lineTo(n.x,n.y),v>0){const e=Lr(w,S,o,a);t.arc(e.x,e.y,v,m-D,S)}}else{t.moveTo(o,a);const e=Math.cos(S)*h+o,n=Math.sin(S)*h+a;t.lineTo(e,n);const i=Math.cos(E)*h+o,r=Math.sin(E)*h+a;t.lineTo(i,r)}t.closePath()}function Nr(t,e,n,i,r,s){const{options:o}=e,{borderWidth:a,borderJoinStyle:l}=o,c="inner"===o.borderAlign;a&&(c?(t.lineWidth=2*a,t.lineJoin=l||"round"):(t.lineWidth=a,t.lineJoin=l||"bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:r,startAngle:s,pixelMargin:o,fullCircles:a}=e,l=Math.max(e.outerRadius-o,0),c=e.innerRadius+o;let u;for(n&&Tr(t,e,s+A),t.beginPath(),t.arc(i,r,c,s+A,s,!0),u=0;u{gi.add(...t),Cr()}},unregister:{enumerable:Ar,value:(...t)=>{gi.remove(...t),Cr()}}});class Ir extends ni{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:s}=U(i,{x:t,y:e}),{startAngle:o,endAngle:a,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=this.options.spacing/2,f=h(u,a-o)>=A||Q(r,o,a),p=G(s,l+d,c+d);return f&&p}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:s,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:l}=this.options,c=(i+r)/2,u=(s+o+l+a)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/2,r=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>A?Math.floor(n/A):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();let o=0;if(i){o=i/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*o,Math.sin(e)*o),this.circumference>=C&&(o=i)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,n,i,r){const{fullCircles:s,startAngle:o,circumference:a}=e;let l=e.endAngle;if(s){Dr(t,e,n,i,o+A,r);for(let e=0;ea&&s>a;return{count:i,start:l,loop:e.loop,ilen:c(o+(c?a-t:t))%s,y=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(l&&(h=r[v(0)],t.moveTo(h.x,h.y)),u=0;u<=a;++u){if(h=r[v(u)],h.skip)continue;const e=h.x,n=h.y,i=0|e;i===d?(np&&(p=n),m=(b*m+e)/++b):(y(),t.lineTo(e,n),d=i,b=0,f=p=n),g=n}y()}function Br(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?$r:jr}Ir.id="arc",Ir.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},Ir.defaultRoutes={backgroundColor:"backgroundColor"};const Vr="function"==typeof Path2D;function Wr(t,e,n,i){Vr&&!e.options.segment?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),Fr(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){const{segments:r,options:s}=e,o=Br(e);for(const a of r)Fr(t,s,a.style),t.beginPath(),o(t,e,a,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}class Hr extends ni{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Ye(this._points,n,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const s=!!t._loop,{start:o,end:a}=function(t,e,n,i){let r=0,s=e-1;if(n&&!i)for(;rr&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}(n,r,s,i);return _n(t,!0===i?[{start:o,end:a,loop:s}]:function(t,e,n,i){const r=t.length,s=[];let o,a=e,l=t[e];for(o=e+1;o<=n;++o){const n=t[o%r];n.skip||n.stop?l.skip||(i=!1,s.push({start:e%r,end:(o-1)%r,loop:i}),e=a=n.stop?o:null):(a=o,l.skip&&(e=o)),l=n}return null!==a&&s.push({start:e%r,end:a%r,loop:i}),s}(n,o,a"borderDash"!==t&&"fill"!==t};class Kr extends ni{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:s}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-s,2){es(t)}))}var is={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void ns(t);const i=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:s,indexAxis:a}=e,l=t.getDatasetMeta(r),c=s||e.data;if("y"===Ee([a,t.options.indexAxis]))return;if(!l.controller.supportsDecimation)return;const u=t.scales[l.xAxisID];if("linear"!==u.type&&"time"!==u.type)return;if(t.options.parsing)return;let{start:h,count:d}=function(t,e){const n=e.length;let i,r=0;const{iScale:s}=t,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=X(Z(e,s.axis,o).lo,0,n-1)),i=c?X(Z(e,s.axis,a).hi+1,r,n)-r:n-r,{start:r,count:i}}(l,c);if(d<=(n.threshold||4*i))return void es(e);let f;switch(o(s)&&(e._data=c,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":f=function(t,e,n,i,r){const s=r.samples||i;if(s>=n)return t.slice(e,e+n);const o=[],a=(n-2)/(s-2);let l=0;const c=e+n-1;let u,h,d,f,p,g=e;for(o[l++]=t[g],u=0;ud&&(d=f,h=t[i],p=i);o[l++]=h,g=p}return o[l++]=t[c],o}(c,h,d,i,n);break;case"min-max":f=function(t,e,n,i){let r,s,a,l,c,u,h,d,f,p,g=0,m=0;const b=[],v=e+n-1,y=t[e].x,_=t[v].x-y;for(r=e;rp&&(p=l,h=r),g=(m*g+s.x)/++m;else{const n=r-1;if(!o(u)&&!o(h)){const e=Math.min(u,h),i=Math.max(u,h);e!==d&&e!==n&&b.push({...t[e],x:g}),i!==d&&i!==n&&b.push({...t[i],x:g})}r>0&&n!==d&&b.push(t[n]),b.push(s),c=e,m=0,f=p=l,u=h=d=r}}return b}(c,h,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=f}))},destroy(t){ns(t)}};function rs(t,e,n,i){if(i)return;let r=e[t],s=n[t];return"angle"===t&&(r=q(r),s=q(s)),{property:t,start:r,end:s}}function ss(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function os(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function as(t,e){let n=[],i=!1;return a(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,s=[];return e.segments.forEach((({start:t,end:e})=>{e=ss(t,e,r);const o=r[t],a=r[e];null!==i?(s.push({x:o.x,y:i}),s.push({x:a.x,y:i})):null!==n&&(s.push({x:n,y:o.y}),s.push({x:n,y:a.y}))})),s}(t,e),n.length?new Hr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function ls(t){return t&&!1!==t.fill}function cs(t,e,n){let i=t[e].fill;const r=[e];let s;if(!n)return i;for(;!1!==i&&-1===r.indexOf(i);){if(!c(i))return i;if(s=t[i],!s)return!1;if(s.visible)return i;r.push(i),i=s.fill}return!1}function us(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=h(n&&n.target,n);void 0===i&&(i=!!e.backgroundColor);if(!1===i||null===i)return!1;if(!0===i)return"origin";return i}(t);if(l(i))return!isNaN(i.value)&&i;let r=parseFloat(i);return c(r)&&Math.floor(r)===r?function(t,e,n,i){"-"!==t&&"+"!==t||(n=e+n);if(n===e||n<0||n>=i)return!1;return n}(i[0],e,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function hs(t,e,n){const i=[];for(let r=0;r=0;--e){const n=r[e].$filler;n&&(n.line.updateControlPoints(s,n.axis),i&&n.fill&&gs(t.ctx,n,s))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;ls(n)&&gs(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;ls(i)&&"beforeDatasetDraw"===n.drawTime&&gs(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const xs=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class ws extends ni{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=f(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,n)=>t.sort(e,n,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,i=Se(n.font),r=i.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:a}=xs(n,r);let l,c;e.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(s,r,o,a)+10):(c=this.maxHeight,l=this._fitCols(s,r,o,a)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:r,maxWidth:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+o;let u=t;r.textAlign="left",r.textBaseline="middle";let h=-1,d=-c;return this.legendItems.forEach(((t,f)=>{const p=n+e/2+r.measureText(t.text).width;(0===f||l[l.length-1]+p+2*o>s)&&(u+=c,l[l.length-(f>0?0:1)]=0,d+=c,h++),a[f]={left:0,top:d,row:h,width:p,height:i},l[l.length-1]+=p+o})),u}_fitCols(t,e,n,i){const{ctx:r,maxHeight:s,options:{labels:{padding:o}}}=this,a=this.legendHitBoxes=[],l=this.columnSizes=[],c=s-t;let u=o,h=0,d=0,f=0,p=0;return this.legendItems.forEach(((t,s)=>{const g=n+e/2+r.measureText(t.text).width;s>0&&d+i+2*o>c&&(u+=h+o,l.push({width:h,height:d}),f+=h+o,p++,h=d=0),a[s]={left:f,top:d,col:p,width:g,height:i},h=Math.max(h,g),d+=i+o})),u+=h,l.push({width:h,height:d}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:i},rtl:r}}=this,s=fn(r,this.left,this.width);if(this.isHorizontal()){let r=0,o=at(n,this.left+i,this.right-this.lineWidths[r]);for(const a of e)r!==a.row&&(r=a.row,o=at(n,this.left+i,this.right-this.lineWidths[r])),a.top+=this.top+t+i,a.left=s.leftForLtr(s.x(o),a.width),o+=a.width+i}else{let r=0,o=at(n,this.top+t+i,this.bottom-this.columnSizes[r].height);for(const a of e)a.col!==r&&(r=a.col,o=at(n,this.top+t+i,this.bottom-this.columnSizes[r].height)),a.top=o,a.left+=this.left+i,a.left=s.leftForLtr(s.x(a.left),a.width),o+=a.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;ce(t,this),this._draw(),ue(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:i}=this,{align:r,labels:s}=t,o=ee.color,a=fn(t.rtl,this.left,this.width),l=Se(s.font),{color:c,padding:u}=s,d=l.size,f=d/2;let p;this.drawTitle(),i.textAlign=a.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=xs(s,d),v=this.isHorizontal(),y=this._computeTitleHeight();p=v?{x:at(r,this.left+u,this.right-n[0]),y:this.top+u+y,line:0}:{x:this.left+u,y:at(r,this.top+y+u,this.bottom-e[0].height),line:0},pn(this.ctx,t.textDirection);const _=b+u;this.legendItems.forEach(((x,w)=>{i.strokeStyle=x.fontColor||c,i.fillStyle=x.fontColor||c;const k=i.measureText(x.text).width,S=a.textAlign(x.textAlign||(x.textAlign=s.textAlign)),E=g+f+k;let O=p.x,M=p.y;a.setWidth(this.width),v?w>0&&O+E+u>this.right&&(M=p.y+=_,p.line++,O=p.x=at(r,this.left+u,this.right-n[p.line])):w>0&&M+_>this.bottom&&(O=p.x=O+e[p.line].width+u,p.line++,M=p.y=at(r,this.top+y+u,this.bottom-e[p.line].height));!function(t,e,n){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const r=h(n.lineWidth,1);if(i.fillStyle=h(n.fillStyle,o),i.lineCap=h(n.lineCap,"butt"),i.lineDashOffset=h(n.lineDashOffset,0),i.lineJoin=h(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=h(n.strokeStyle,o),i.setLineDash(h(n.lineDash,[])),s.usePointStyle){const o={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},l=a.xPlus(t,g/2);ae(i,o,l,e+f,s.pointStyleWidth&&g)}else{const s=e+Math.max((d-m)/2,0),o=a.leftForLtr(t,g),l=we(n.borderRadius);i.beginPath(),Object.values(l).some((t=>0!==t))?ge(i,{x:o,y:s,w:g,h:m,radius:l}):i.rect(o,s,g,m),i.fill(),0!==r&&i.stroke()}i.restore()}(a.x(O),M,x),O=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(S,O+g+f,v?O+E:this.right,t.rtl),function(t,e,n){fe(i,n.text,t,e+b/2,l,{strikethrough:n.hidden,textAlign:a.textAlign(n.textAlign)})}(a.x(O),M,x),v?p.x+=E+u:p.y+=_})),gn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Se(e.font),i=ke(e.padding);if(!e.display)return;const r=fn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,a=n.size/2,l=i.top+a;let c,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,u=at(t.align,u,this.right-h);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);c=l+at(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const d=at(o,u,u+h);s.textAlign=r.textAlign(ot(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=n.string,fe(s,e.text,d,c,n)}_computeTitleHeight(){const t=this.options.title,e=Se(t.font),n=ke(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,r;if(G(t,this.left,this.right)&&G(e,this.top,this.bottom))for(r=this.legendHitBoxes,n=0;nt.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const o=t.controller.getStyle(n?0:void 0),a=ke(o.borderWidth);return{text:e[t.index].label,fillStyle:o.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:(a.width+a.height)/4,strokeStyle:o.borderColor,pointStyle:i||o.pointStyle,rotation:o.rotation,textAlign:r||o.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Ss extends ni{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const i=a(n.text)?n.text.length:1;this._padding=ke(n.padding);const r=i*Se(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:i,right:r,options:s}=this,o=s.align;let a,l,c,u=0;return this.isHorizontal()?(l=at(o,n,r),c=e+t,a=r-n):("left"===s.position?(l=n+t,c=at(o,i,e),u=-.5*C):(l=r-t,c=at(o,e,i),u=.5*C),a=i-e),{titleX:l,titleY:c,maxWidth:a,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=Se(e.font),i=n.lineHeight/2+this._padding.top,{titleX:r,titleY:s,maxWidth:o,rotation:a}=this._drawArgs(i);fe(t,e.text,0,0,n,{color:e.color,maxWidth:o,rotation:a,textAlign:ot(e.align),textBaseline:"middle",translation:[r,s]})}}var Es={id:"title",_element:Ss,start(t,e,n){!function(t,e){const n=new Ss({ctx:t.ctx,options:e,chart:t});$i.configure(t,n,e),$i.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;$i.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;$i.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Os=new WeakMap;var Ms={id:"subtitle",start(t,e,n){const i=new Ss({ctx:t.ctx,options:n,chart:t});$i.configure(t,i,n),$i.addBox(t,i),Os.set(t,i)},stop(t){$i.removeBox(t,Os.get(t)),Os.delete(t)},beforeUpdate(t,e,n){const i=Os.get(t);$i.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cs={average(t){if(!t.length)return!1;let e,n,i=0,r=0,s=0;for(e=0,n=t.length;e-1?t.split("\n"):t}function Ps(t,e){const{element:n,datasetIndex:i,index:r}=e,s=t.getDatasetMeta(i).controller,{label:o,value:a}=s.getLabelAndValue(r);return{chart:t,label:o,parsed:s.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:a,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Ls(t,e){const n=t.chart.ctx,{body:i,footer:r,title:s}=t,{boxWidth:o,boxHeight:a}=e,l=Se(e.bodyFont),c=Se(e.titleFont),u=Se(e.footerFont),h=s.length,d=r.length,f=i.length,g=ke(e.padding);let m=g.height,b=0,v=i.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(v+=t.beforeBody.length+t.afterBody.length,h&&(m+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),v){m+=f*(e.displayColors?Math.max(a,l.lineHeight):l.lineHeight)+(v-f)*l.lineHeight+(v-1)*e.bodySpacing}d&&(m+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let y=0;const _=function(t){b=Math.max(b,n.measureText(t).width+y)};return n.save(),n.font=c.string,p(t.title,_),n.font=l.string,p(t.beforeBody.concat(t.afterBody),_),y=e.displayColors?o+2+e.boxPadding:0,p(i,(t=>{p(t.before,_),p(t.lines,_),p(t.after,_)})),y=0,n.font=u.string,p(t.footer,_),n.restore(),b+=g.width,{width:b,height:m}}function Ds(t,e,n,i){const{x:r,width:s}=n,{width:o,chartArea:{left:a,right:l}}=t;let c="center";return"center"===i?c=r<=(a+l)/2?"left":"right":r<=s/2?c="left":r>=o-s/2&&(c="right"),function(t,e,n,i){const{x:r,width:s}=i,o=n.caretSize+n.caretPadding;return"left"===t&&r+s+o>e.width||"right"===t&&r-s-o<0||void 0}(c,t,e,n)&&(c="center"),c}function Ns(t,e,n){const i=n.yAlign||e.yAlign||function(t,e){const{y:n,height:i}=e;return nt.height-i/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||Ds(t,e,n,i),yAlign:i}}function Is(t,e,n,i){const{caretSize:r,caretPadding:s,cornerRadius:o}=t,{xAlign:a,yAlign:l}=n,c=r+s,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=we(o);let p=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,a);const g=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(e,l,c);return"center"===l?"left"===a?p+=c:"right"===a&&(p-=c):"left"===a?p-=Math.max(u,d)+r:"right"===a&&(p+=Math.max(h,f)+r),{x:X(p,0,i.width-e.width),y:X(g,0,i.height-e.height)}}function Fs(t,e,n){const i=ke(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Rs(t){return As([],Ts(t))}function zs(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class js extends ni{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,r=new Cn(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,n=this._tooltipItems,Oe(t,{tooltip:e,tooltipItems:n,type:"tooltip"})));var t,e,n}getTitle(t,e){const{callbacks:n}=e,i=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),s=n.afterTitle.apply(this,[t]);let o=[];return o=As(o,Ts(i)),o=As(o,Ts(r)),o=As(o,Ts(s)),o}getBeforeBody(t,e){return Rs(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,i=[];return p(t,(t=>{const e={before:[],lines:[],after:[]},r=zs(n,t);As(e.before,Ts(r.beforeLabel.call(this,t))),As(e.lines,r.label.call(this,t)),As(e.after,Ts(r.afterLabel.call(this,t))),i.push(e)})),i}getAfterBody(t,e){return Rs(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,i=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),s=n.afterFooter.apply(this,[t]);let o=[];return o=As(o,Ts(i)),o=As(o,Ts(r)),o=As(o,Ts(s)),o}_createItems(t){const e=this._active,n=this.chart.data,i=[],r=[],s=[];let o,a,l=[];for(o=0,a=e.length;ot.filter(e,i,r,n)))),t.itemSort&&(l=l.sort(((e,i)=>t.itemSort(e,i,n)))),p(l,(e=>{const n=zs(t.callbacks,e);i.push(n.labelColor.call(this,e)),r.push(n.labelPointStyle.call(this,e)),s.push(n.labelTextColor.call(this,e))})),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let r,s=[];if(i.length){const t=Cs[n.position].call(this,i,this._eventPosition);s=this._createItems(n),this.title=this.getTitle(s,n),this.beforeBody=this.getBeforeBody(s,n),this.body=this.getBody(s,n),this.afterBody=this.getAfterBody(s,n),this.footer=this.getFooter(s,n);const e=this._size=Ls(this,n),o=Object.assign({},t,e),a=Ns(this.chart,n,o),l=Is(n,o,a,this.chart);this.xAlign=a.xAlign,this.yAlign=a.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=s,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{caretSize:s,cornerRadius:o}=n,{topLeft:a,topRight:l,bottomLeft:c,bottomRight:u}=we(o),{x:h,y:d}=t,{width:f,height:p}=e;let g,m,b,v,y,_;return"center"===r?(y=d+p/2,"left"===i?(g=h,m=g-s,v=y+s,_=y-s):(g=h+f,m=g+s,v=y-s,_=y+s),b=g):(m="left"===i?h+Math.max(a,c)+s:"right"===i?h+f-Math.max(l,u)-s:this.caretX,"top"===r?(v=d,y=v-s,g=m-s,b=m+s):(v=d+p,y=v+s,g=m+s,b=m-s),_=v),{x1:g,x2:m,x3:b,y1:v,y2:y,y3:_}}drawTitle(t,e,n){const i=this.title,r=i.length;let s,o,a;if(r){const l=fn(n.rtl,this.x,this.width);for(t.x=Fs(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",s=Se(n.titleFont),o=n.titleSpacing,e.fillStyle=n.titleColor,e.font=s.string,a=0;a0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ge(t,{x:e,y:g,w:c,h:a,radius:o}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),ge(t,{x:n,y:g+1,w:c-2,h:a-2,radius:o}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,g,c,a),t.strokeRect(e,g,c,a),t.fillStyle=s.backgroundColor,t.fillRect(n,g+1,c-2,a-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:r,bodyAlign:s,displayColors:o,boxHeight:a,boxWidth:l,boxPadding:c}=n,u=Se(n.bodyFont);let h=u.lineHeight,d=0;const f=fn(n.rtl,this.x,this.width),g=function(n){e.fillText(n,f.x(t.x+d),t.y+h/2),t.y+=h+r},m=f.textAlign(s);let b,v,y,_,x,w,k;for(e.textAlign=s,e.textBaseline="middle",e.font=u.string,t.x=Fs(this,m,n),e.fillStyle=n.bodyColor,p(this.beforeBody,g),d=o&&"right"!==m?"center"===s?l/2+c:l+2+c:0,_=0,w=i.length;_0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const n=Cs[t.position].call(this,this._active,this._eventPosition);if(!n)return;const s=this._size=Ls(this,t),o=Object.assign({},n,this._size),a=Ns(e,t,o),l=Is(t,o,a,e);i._to===l.x&&r._to===l.y||(this.xAlign=a.xAlign,this.yAlign=a.yAlign,this.width=s.width,this.height=s.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const s=ke(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,e),pn(t,e.textDirection),r.y+=s.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),gn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map((({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}})),r=!g(n,i),s=this._positionChanged(i,e);(r||s)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],s=this._getActiveElements(t,r,e,n),o=this._positionChanged(s,t),a=e||!g(s,r)||o;return a&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,n,i){const r=this.options;if("mouseout"===t.type)return[];if(!i)return e;const s=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,s=Cs[r.position].call(this,t,e);return!1!==s&&(n!==s.x||i!==s.y)}}js.positioners=Cs;var $s={id:"tooltip",_element:js,positioners:Cs,afterInit(t,e,n){n&&(t.tooltip=new js({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",n))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:r,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Bs=Object.freeze({__proto__:null,Decimation:is,Filler:_s,Legend:ks,SubTitle:Ms,Title:Es,Tooltip:$s});function Vs(t,e,n,i){const r=t.indexOf(e);if(-1===r)return((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i);return r!==t.lastIndexOf(e)?n:r}class Ws extends fi{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(o(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:X(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:Vs(n,t,h(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)i.push({value:n});return i}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Hs(t,e){const n=[],{bounds:i,step:r,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:d}=t,f=r||1,p=u-1,{min:g,max:m}=e,b=!o(s),v=!o(a),y=!o(c),_=(m-g)/(h+1);let x,w,k,S,E=z((m-g)/p/f)*f;if(E<1e-14&&!b&&!v)return[{value:g},{value:m}];S=Math.ceil(m/E)-Math.floor(g/E),S>p&&(E=z(S*E/p/f)*f),o(l)||(x=Math.pow(10,l),E=Math.ceil(E*x)/x),"ticks"===i?(w=Math.floor(g/E)*E,k=Math.ceil(m/E)*E):(w=g,k=m),b&&v&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-s)/r,E/1e3)?(S=Math.round(Math.min((a-s)/E,u)),E=(a-s)/S,w=s,k=a):y?(w=b?s:w,k=v?a:k,S=c-1,E=(k-w)/S):(S=(k-w)/E,S=$(S,Math.round(S),E/1e3)?Math.round(S):Math.ceil(S));const O=Math.max(H(E),H(w));x=Math.pow(10,o(l)?O:l),w=Math.round(w*x)/x,k=Math.round(k*x)/x;let M=0;for(b&&(d&&w!==s?(n.push({value:s}),wi=e?i:t,o=t=>r=n?r:t;if(t){const t=R(i),e=R(r);t<0&&e<0?o(0):t>0&&e>0&&s(0)}if(i===r){let e=1;(r>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*r)),o(r+e),t||s(i-e)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=Hs({maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&B(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return dn(t,this.chart.options.locale,this.options.ticks.format)}}class Ys extends Ks{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=c(t)?t:0,this.max=c(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=V(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function qs(t){return 1===t/Math.pow(10,Math.floor(F(t)))}Ys.id="linear",Ys.defaults={ticks:{callback:ri.formatters.numeric}};class Qs extends fi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Ks.prototype.parse.apply(this,[t,e]);if(0!==n)return c(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=c(t)?Math.max(0,t):null,this.max=c(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,i=this.max;const r=e=>n=t?n:e,s=t=>i=e?i:t,o=(t,e)=>Math.pow(10,Math.floor(F(t))+e);n===i&&(n<=0?(r(1),s(10)):(r(o(n,-1)),s(o(i,1)))),n<=0&&r(o(i,-1)),i<=0&&s(o(n,1)),this._zero&&this.min!==this._suggestedMin&&n===o(this.min,0)&&r(o(n,-1)),this.min=n,this.max=i}buildTicks(){const t=this.options,e=function(t,e){const n=Math.floor(F(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),r=[];let s=u(t.min,Math.pow(10,Math.floor(F(e.min)))),o=Math.floor(F(s)),a=Math.floor(s/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{r.push({value:s,major:qs(s)}),++a,10===a&&(a=1,++o,l=o>=0?1:l),s=Math.round(a*Math.pow(10,o)*l)/l}while(or?{start:e-n,end:e}:{start:e,end:e+n}}function Js(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],r=[],s=t._pointLabels.length,o=t.options.pointLabels,l=o.centerPointLabels?C/s:0;for(let d=0;de.r&&(a=(i.end-e.r)/s,t.r=Math.max(t.r,e.r+a)),r.starte.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function to(t){return 0===t||180===t?"center":t<180?"left":"right"}function eo(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function no(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function io(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,A);else{let n=t.getPointPosition(0,e);r.moveTo(n.x,n.y);for(let s=1;s{const n=f(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?Js(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,i))}getIndexAngle(t){return q(t*(A/(this._pointLabels.length||1))+V(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(o(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(o(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;r--){const e=i.setContext(t.getPointLabelContext(r)),s=Se(e.font),{x:a,y:l,textAlign:c,left:u,top:h,right:d,bottom:f}=t._pointLabelItems[r],{backdropColor:p}=e;if(!o(p)){const t=we(e.borderRadius),i=ke(e.backdropPadding);n.fillStyle=p;const r=u-i.left,s=h-i.top,o=d-u+i.width,a=f-h+i.height;Object.values(t).some((t=>0!==t))?(n.beginPath(),ge(n,{x:r,y:s,w:o,h:a,radius:t}),n.fill()):n.fillRect(r,s,o,a)}fe(n,t._pointLabels[r],a,l+s.lineHeight/2,s,{color:e.color,textAlign:c,textBaseline:"middle"})}}(this,r),i.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);!function(t,e,n,i){const r=t.ctx,s=e.circular,{color:o,lineWidth:a}=e;!s&&!i||!o||!a||n<0||(r.save(),r.strokeStyle=o,r.lineWidth=a,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),io(t,n,s,i),r.closePath(),r.stroke(),r.restore())}(this,i.setContext(this.getContext(e-1)),a,r)}})),n.display){for(t.save(),s=r-1;s>=0;s--){const i=n.setContext(this.getPointLabelContext(s)),{color:r,lineWidth:o}=i;o&&r&&(t.lineWidth=o,t.strokeStyle=r,t.setLineDash(i.borderDash),t.lineDashOffset=i.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(s,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let r,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((i,o)=>{if(0===o&&!e.reverse)return;const a=n.setContext(this.getContext(o)),l=Se(a.font);if(r=this.getDistanceFromCenterForValue(this.ticks[o].value),a.showLabelBackdrop){t.font=l.string,s=t.measureText(i.label).width,t.fillStyle=a.backdropColor;const e=ke(a.backdropPadding);t.fillRect(-s/2-e.left,-r-l.size/2-e.top,s+e.width,l.size+e.height)}fe(t,i.label,0,-r,l,{color:a.color})})),t.restore()}drawTitle(){}}ro.id="radialLinear",ro.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ri.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},ro.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ro.descriptors={angleLines:{_fallback:"grid"}};const so={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}},oo=Object.keys(so);function ao(t,e){return t-e}function lo(t,e){if(o(e))return null;const n=t._adapter,{parser:i,round:r,isoWeekday:s}=t._parseOpts;let a=e;return"function"==typeof i&&(a=i(a)),c(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null===a?null:(r&&(a="week"!==r||!j(s)&&!0!==s?n.startOf(a,r):n.startOf(a,"isoWeek",s)),+a)}function co(t,e,n,i){const r=oo.length;for(let s=oo.indexOf(t);s=e?n[i]:n[r]]=!0}}else t[e]=!0}function ho(t,e,n){const i=[],r={},s=e.length;let o,a;for(o=0;o=0&&(e[l].major=!0);return e}(t,i,r,n):i}class fo extends fi{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new _i._date(t.adapters.date);i.init(e),_(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:lo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:i,max:r,minDefined:s,maxDefined:o}=this.getUserBounds();function a(t){s||isNaN(t.min)||(i=Math.min(i,t.min)),o||isNaN(t.max)||(r=Math.max(r,t.max))}s&&o||(a(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||a(this.getMinMax(!1))),i=c(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),r=c(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const r=this.min,s=function(t,e,n){let i=0,r=t.length;for(;ii&&t[r-1]>n;)r--;return i>0||r=oo.indexOf(n);s--){const n=oo[s];if(so[n].common&&t._adapter.diff(r,i,n)>=e-1)return n}return oo[n?oo.indexOf(n):0]}(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=oo.indexOf(t)+1,n=oo.length;e+t.value)))}initOffsets(t){let e,n,i=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),r=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;i=X(i,0,s),r=X(r,0,s),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,r=i.time,s=r.unit||co(r.minUnit,e,n,this._getLabelCapacity(e)),o=h(r.stepSize,1),a="week"===s&&r.isoWeekday,l=j(a)||!0===a,c={};let u,d,f=e;if(l&&(f=+t.startOf(f,"isoWeek",a)),f=+t.startOf(f,l?"day":s),t.diff(n,e,s)>1e5*o)throw new Error(e+" and "+n+" are too far apart with stepSize of "+o+" "+s);const p="data"===i.ticks.source&&this.getDataTimestamps();for(u=f,d=0;ut-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const r=this.options,s=r.time.displayFormats,o=this._unit,a=this._majorUnit,l=o&&s[o],c=a&&s[a],u=n[e],h=a&&c&&u&&u.major,d=this._adapter.format(t,i||(h?c:l)),p=r.ticks.callback;return p?f(p,[d,e,n],this):d}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e0?o:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(t=0,e=i.length;t=t[a].pos&&e<=t[l].pos&&({lo:a,hi:l}=Z(t,"pos",e)),({pos:i,time:s}=t[a]),({pos:r,time:o}=t[l])):(e>=t[a].time&&e<=t[l].time&&({lo:a,hi:l}=Z(t,"time",e)),({time:i,pos:s}=t[a]),({time:r,pos:o}=t[l]));const c=r-i;return c?s+(o-s)*(e-i)/c:s}fo.id="time",fo.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class go extends fo{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=po(e,this.min),this._tableRange=po(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,i=[],r=[];let s,o,a,l,c;for(s=0,o=t.length;s=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(s=0,o=i.length;s{t.style.width=e}),0)}}}dispatchEvent(t,e){this.dispatch(t,{detail:e,prefix:"chartjs"})}}yo.values={view:Object}},4517:(t,e,n)=>{function i(t){const e={};var n;(n=t).keys().forEach((t=>e[t]=n(t).default)),window.resolveReactComponent=t=>{const n=e[`./${t}.jsx`]||e[`./${t}.tsx`];if(void 0===n){const n=Object.keys(e).map((t=>t.replace("./","").replace(".jsx","").replace(".tsx","")));throw new Error(`React controller "${t}" does not exist. Possible values: ${n.join(", ")}`)}return n}}n.d(e,{$:()=>i})},666:(t,e,n)=>{n.d(e,{A:()=>l});var i,r=n(6540),s=n(961),o=n(2891),a=s;i=a.createRoot,a.hydrateRoot;class l extends o.xI{connect(){const t=this.propsValue?this.propsValue:null;if(this.dispatchEvent("connect",{component:this.componentValue,props:t}),!this.componentValue)throw new Error("No component specified.");const e=window.resolveReactComponent(this.componentValue);this._renderReactElement(r.createElement(e,t,null)),this.dispatchEvent("mount",{componentName:this.componentValue,component:e,props:t})}disconnect(){this.element.root.unmount(),this.dispatchEvent("unmount",{component:this.componentValue,props:this.propsValue?this.propsValue:null})}_renderReactElement(t){const e=this.element;e.root||(e.root=i(this.element)),e.root.render(t)}dispatchEvent(t,e){this.dispatch(t,{detail:e,prefix:"react"})}}l.values={component:String,props:Object}},9336:(t,e,n)=>{var i={};n.r(i),n.d(i,{afterMain:()=>k,afterRead:()=>_,afterWrite:()=>O,applyStyles:()=>D,arrow:()=>Z,auto:()=>l,basePlacements:()=>c,beforeMain:()=>x,beforeRead:()=>v,beforeWrite:()=>S,bottom:()=>s,clippingParents:()=>d,computeStyles:()=>it,createPopper:()=>Dt,createPopperBase:()=>Lt,createPopperLite:()=>Nt,detectOverflow:()=>yt,end:()=>h,eventListeners:()=>st,flip:()=>_t,hide:()=>kt,left:()=>a,main:()=>w,modifierPhases:()=>M,offset:()=>St,placements:()=>b,popper:()=>p,popperGenerator:()=>Pt,popperOffsets:()=>Et,preventOverflow:()=>Ot,read:()=>y,reference:()=>g,right:()=>o,start:()=>u,top:()=>r,variationPlacements:()=>m,viewport:()=>f,write:()=>E});var r="top",s="bottom",o="right",a="left",l="auto",c=[r,s,o,a],u="start",h="end",d="clippingParents",f="viewport",p="popper",g="reference",m=c.reduce((function(t,e){return t.concat([e+"-"+u,e+"-"+h])}),[]),b=[].concat(c,[l]).reduce((function(t,e){return t.concat([e,e+"-"+u,e+"-"+h])}),[]),v="beforeRead",y="read",_="afterRead",x="beforeMain",w="main",k="afterMain",S="beforeWrite",E="write",O="afterWrite",M=[v,y,_,x,w,k,S,E,O];function C(t){return t?(t.nodeName||"").toLowerCase():null}function A(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function T(t){return t instanceof A(t).Element||t instanceof Element}function P(t){return t instanceof A(t).HTMLElement||t instanceof HTMLElement}function L(t){return"undefined"!=typeof ShadowRoot&&(t instanceof A(t).ShadowRoot||t instanceof ShadowRoot)}const D={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];P(r)&&C(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var i=e.elements[t],r=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});P(i)&&C(i)&&(Object.assign(i.style,s),Object.keys(r).forEach((function(t){i.removeAttribute(t)})))}))}},requires:["computeStyles"]};function N(t){return t.split("-")[0]}var I=Math.max,F=Math.min,R=Math.round;function z(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function j(){return!/^((?!chrome|android).)*safari/i.test(z())}function $(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),r=1,s=1;e&&P(t)&&(r=t.offsetWidth>0&&R(i.width)/t.offsetWidth||1,s=t.offsetHeight>0&&R(i.height)/t.offsetHeight||1);var o=(T(t)?A(t):window).visualViewport,a=!j()&&n,l=(i.left+(a&&o?o.offsetLeft:0))/r,c=(i.top+(a&&o?o.offsetTop:0))/s,u=i.width/r,h=i.height/s;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function B(t){var e=$(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function V(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&L(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function W(t){return A(t).getComputedStyle(t)}function H(t){return["table","td","th"].indexOf(C(t))>=0}function U(t){return((T(t)?t.ownerDocument:t.document)||window.document).documentElement}function K(t){return"html"===C(t)?t:t.assignedSlot||t.parentNode||(L(t)?t.host:null)||U(t)}function Y(t){return P(t)&&"fixed"!==W(t).position?t.offsetParent:null}function q(t){for(var e=A(t),n=Y(t);n&&H(n)&&"static"===W(n).position;)n=Y(n);return n&&("html"===C(n)||"body"===C(n)&&"static"===W(n).position)?e:n||function(t){var e=/firefox/i.test(z());if(/Trident/i.test(z())&&P(t)&&"fixed"===W(t).position)return null;var n=K(t);for(L(n)&&(n=n.host);P(n)&&["html","body"].indexOf(C(n))<0;){var i=W(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function Q(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function X(t,e,n){return I(t,F(e,n))}function G(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function J(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}const Z={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,l=t.options,u=n.elements.arrow,h=n.modifiersData.popperOffsets,d=N(n.placement),f=Q(d),p=[a,o].indexOf(d)>=0?"height":"width";if(u&&h){var g=function(t,e){return G("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:J(t,c))}(l.padding,n),m=B(u),b="y"===f?r:a,v="y"===f?s:o,y=n.rects.reference[p]+n.rects.reference[f]-h[f]-n.rects.popper[p],_=h[f]-n.rects.reference[f],x=q(u),w=x?"y"===f?x.clientHeight||0:x.clientWidth||0:0,k=y/2-_/2,S=g[b],E=w-m[p]-g[v],O=w/2-m[p]/2+k,M=X(S,O,E),C=f;n.modifiersData[i]=((e={})[C]=M,e.centerOffset=M-O,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&V(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tt(t){return t.split("-")[1]}var et={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nt(t){var e,n=t.popper,i=t.popperRect,l=t.placement,c=t.variation,u=t.offsets,d=t.position,f=t.gpuAcceleration,p=t.adaptive,g=t.roundOffsets,m=t.isFixed,b=u.x,v=void 0===b?0:b,y=u.y,_=void 0===y?0:y,x="function"==typeof g?g({x:v,y:_}):{x:v,y:_};v=x.x,_=x.y;var w=u.hasOwnProperty("x"),k=u.hasOwnProperty("y"),S=a,E=r,O=window;if(p){var M=q(n),C="clientHeight",T="clientWidth";if(M===A(n)&&"static"!==W(M=U(n)).position&&"absolute"===d&&(C="scrollHeight",T="scrollWidth"),l===r||(l===a||l===o)&&c===h)E=s,_-=(m&&M===O&&O.visualViewport?O.visualViewport.height:M[C])-i.height,_*=f?1:-1;if(l===a||(l===r||l===s)&&c===h)S=o,v-=(m&&M===O&&O.visualViewport?O.visualViewport.width:M[T])-i.width,v*=f?1:-1}var P,L=Object.assign({position:d},p&&et),D=!0===g?function(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:R(n*r)/r||0,y:R(i*r)/r||0}}({x:v,y:_},A(n)):{x:v,y:_};return v=D.x,_=D.y,f?Object.assign({},L,((P={})[E]=k?"0":"",P[S]=w?"0":"",P.transform=(O.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",P)):Object.assign({},L,((e={})[E]=k?_+"px":"",e[S]=w?v+"px":"",e.transform="",e))}const it={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,l=void 0===a||a,c={placement:N(e.placement),variation:tt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,nt(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,nt(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var rt={passive:!0};const st={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,s=void 0===r||r,o=i.resize,a=void 0===o||o,l=A(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",n.update,rt)})),a&&l.addEventListener("resize",n.update,rt),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",n.update,rt)})),a&&l.removeEventListener("resize",n.update,rt)}},data:{}};var ot={left:"right",right:"left",bottom:"top",top:"bottom"};function at(t){return t.replace(/left|right|bottom|top/g,(function(t){return ot[t]}))}var lt={start:"end",end:"start"};function ct(t){return t.replace(/start|end/g,(function(t){return lt[t]}))}function ut(t){var e=A(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ht(t){return $(U(t)).left+ut(t).scrollLeft}function dt(t){var e=W(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function ft(t){return["html","body","#document"].indexOf(C(t))>=0?t.ownerDocument.body:P(t)&&dt(t)?t:ft(K(t))}function pt(t,e){var n;void 0===e&&(e=[]);var i=ft(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),s=A(i),o=r?[s].concat(s.visualViewport||[],dt(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(pt(K(o)))}function gt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,n){return e===f?gt(function(t,e){var n=A(t),i=U(t),r=n.visualViewport,s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;var c=j();(c||!c&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a+ht(t),y:l}}(t,n)):T(e)?function(t,e){var n=$(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):gt(function(t){var e,n=U(t),i=ut(t),r=null==(e=t.ownerDocument)?void 0:e.body,s=I(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=I(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+ht(t),l=-i.scrollTop;return"rtl"===W(r||n).direction&&(a+=I(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}(U(t)))}function bt(t,e,n,i){var r="clippingParents"===e?function(t){var e=pt(K(t)),n=["absolute","fixed"].indexOf(W(t).position)>=0&&P(t)?q(t):t;return T(n)?e.filter((function(t){return T(t)&&V(t,n)&&"body"!==C(t)})):[]}(t):[].concat(e),s=[].concat(r,[n]),o=s[0],a=s.reduce((function(e,n){var r=mt(t,n,i);return e.top=I(r.top,e.top),e.right=F(r.right,e.right),e.bottom=F(r.bottom,e.bottom),e.left=I(r.left,e.left),e}),mt(t,o,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function vt(t){var e,n=t.reference,i=t.element,l=t.placement,c=l?N(l):null,d=l?tt(l):null,f=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2;switch(c){case r:e={x:f,y:n.y-i.height};break;case s:e={x:f,y:n.y+n.height};break;case o:e={x:n.x+n.width,y:p};break;case a:e={x:n.x-i.width,y:p};break;default:e={x:n.x,y:n.y}}var g=c?Q(c):null;if(null!=g){var m="y"===g?"height":"width";switch(d){case u:e[g]=e[g]-(n[m]/2-i[m]/2);break;case h:e[g]=e[g]+(n[m]/2-i[m]/2)}}return e}function yt(t,e){void 0===e&&(e={});var n=e,i=n.placement,a=void 0===i?t.placement:i,l=n.strategy,u=void 0===l?t.strategy:l,h=n.boundary,m=void 0===h?d:h,b=n.rootBoundary,v=void 0===b?f:b,y=n.elementContext,_=void 0===y?p:y,x=n.altBoundary,w=void 0!==x&&x,k=n.padding,S=void 0===k?0:k,E=G("number"!=typeof S?S:J(S,c)),O=_===p?g:p,M=t.rects.popper,C=t.elements[w?O:_],A=bt(T(C)?C:C.contextElement||U(t.elements.popper),m,v,u),P=$(t.elements.reference),L=vt({reference:P,element:M,strategy:"absolute",placement:a}),D=gt(Object.assign({},M,L)),N=_===p?D:P,I={top:A.top-N.top+E.top,bottom:N.bottom-A.bottom+E.bottom,left:A.left-N.left+E.left,right:N.right-A.right+E.right},F=t.modifiersData.offset;if(_===p&&F){var R=F[a];Object.keys(I).forEach((function(t){var e=[o,s].indexOf(t)>=0?1:-1,n=[r,s].indexOf(t)>=0?"y":"x";I[t]+=R[n]*e}))}return I}const _t={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var h=n.mainAxis,d=void 0===h||h,f=n.altAxis,p=void 0===f||f,g=n.fallbackPlacements,v=n.padding,y=n.boundary,_=n.rootBoundary,x=n.altBoundary,w=n.flipVariations,k=void 0===w||w,S=n.allowedAutoPlacements,E=e.options.placement,O=N(E),M=g||(O===E||!k?[at(E)]:function(t){if(N(t)===l)return[];var e=at(t);return[ct(t),e,ct(e)]}(E)),C=[E].concat(M).reduce((function(t,n){return t.concat(N(n)===l?function(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?b:l,h=tt(i),d=h?a?m:m.filter((function(t){return tt(t)===h})):c,f=d.filter((function(t){return u.indexOf(t)>=0}));0===f.length&&(f=d);var p=f.reduce((function(e,n){return e[n]=yt(t,{placement:n,boundary:r,rootBoundary:s,padding:o})[N(n)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}(e,{placement:n,boundary:y,rootBoundary:_,padding:v,flipVariations:k,allowedAutoPlacements:S}):n)}),[]),A=e.rects.reference,T=e.rects.popper,P=new Map,L=!0,D=C[0],I=0;I=0,$=j?"width":"height",B=yt(e,{placement:F,boundary:y,rootBoundary:_,altBoundary:x,padding:v}),V=j?z?o:a:z?s:r;A[$]>T[$]&&(V=at(V));var W=at(V),H=[];if(d&&H.push(B[R]<=0),p&&H.push(B[V]<=0,B[W]<=0),H.every((function(t){return t}))){D=F,L=!1;break}P.set(F,H)}if(L)for(var U=function(t){var e=C.find((function(e){var n=P.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return D=e,"break"},K=k?3:1;K>0;K--){if("break"===U(K))break}e.placement!==D&&(e.modifiersData[i]._skip=!0,e.placement=D,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function xt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function wt(t){return[r,o,s,a].some((function(e){return t[e]>=0}))}const kt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=yt(e,{elementContext:"reference"}),a=yt(e,{altBoundary:!0}),l=xt(o,i),c=xt(a,r,s),u=wt(l),h=wt(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}};const St={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,s=n.offset,l=void 0===s?[0,0]:s,c=b.reduce((function(t,n){return t[n]=function(t,e,n){var i=N(t),s=[a,r].indexOf(i)>=0?-1:1,l="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=l[0],u=l[1];return c=c||0,u=(u||0)*s,[a,o].indexOf(i)>=0?{x:u,y:c}:{x:c,y:u}}(n,e.rects,l),t}),{}),u=c[e.placement],h=u.x,d=u.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=h,e.modifiersData.popperOffsets.y+=d),e.modifiersData[i]=c}};const Et={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=vt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}};const Ot={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,l=n.mainAxis,c=void 0===l||l,h=n.altAxis,d=void 0!==h&&h,f=n.boundary,p=n.rootBoundary,g=n.altBoundary,m=n.padding,b=n.tether,v=void 0===b||b,y=n.tetherOffset,_=void 0===y?0:y,x=yt(e,{boundary:f,rootBoundary:p,padding:m,altBoundary:g}),w=N(e.placement),k=tt(e.placement),S=!k,E=Q(w),O="x"===E?"y":"x",M=e.modifiersData.popperOffsets,C=e.rects.reference,A=e.rects.popper,T="function"==typeof _?_(Object.assign({},e.rects,{placement:e.placement})):_,P="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),L=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(M){if(c){var R,z="y"===E?r:a,j="y"===E?s:o,$="y"===E?"height":"width",V=M[E],W=V+x[z],H=V-x[j],U=v?-A[$]/2:0,K=k===u?C[$]:A[$],Y=k===u?-A[$]:-C[$],G=e.elements.arrow,J=v&&G?B(G):{width:0,height:0},Z=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=Z[z],nt=Z[j],it=X(0,C[$],J[$]),rt=S?C[$]/2-U-it-et-P.mainAxis:K-it-et-P.mainAxis,st=S?-C[$]/2+U+it+nt+P.mainAxis:Y+it+nt+P.mainAxis,ot=e.elements.arrow&&q(e.elements.arrow),at=ot?"y"===E?ot.clientTop||0:ot.clientLeft||0:0,lt=null!=(R=null==L?void 0:L[E])?R:0,ct=V+st-lt,ut=X(v?F(W,V+rt-lt-at):W,V,v?I(H,ct):H);M[E]=ut,D[E]=ut-V}if(d){var ht,dt="x"===E?r:a,ft="x"===E?s:o,pt=M[O],gt="y"===O?"height":"width",mt=pt+x[dt],bt=pt-x[ft],vt=-1!==[r,a].indexOf(w),_t=null!=(ht=null==L?void 0:L[O])?ht:0,xt=vt?mt:pt-C[gt]-A[gt]-_t+P.altAxis,wt=vt?pt+C[gt]+A[gt]-_t-P.altAxis:bt,kt=v&&vt?function(t,e,n){var i=X(t,e,n);return i>n?n:i}(xt,pt,wt):X(v?xt:mt,pt,v?wt:bt);M[O]=kt,D[O]=kt-pt}e.modifiersData[i]=D}},requiresIfExists:["offset"]};function Mt(t,e,n){void 0===n&&(n=!1);var i,r,s=P(e),o=P(e)&&function(t){var e=t.getBoundingClientRect(),n=R(e.width)/t.offsetWidth||1,i=R(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=U(e),l=$(t,o,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!n)&&(("body"!==C(e)||dt(a))&&(c=(i=e)!==A(i)&&P(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:ut(i)),P(e)?((u=$(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):a&&(u.x=ht(a))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function Ct(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}})),i.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||r(t)})),i}var At={placement:"bottom",modifiers:[],strategy:"absolute"};function Tt(){for(var t=arguments.length,e=new Array(t),n=0;nIt.has(t)&&It.get(t).get(e)||null,remove(t,e){if(!It.has(t))return;const n=It.get(t);n.delete(e),0===n.size&&It.delete(t)}},Rt="transitionend",zt=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,((t,e)=>`#${CSS.escape(e)}`))),t),jt=t=>{t.dispatchEvent(new Event(Rt))},$t=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),Bt=t=>$t(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(zt(t)):null,Vt=t=>{if(!$t(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),n=t.closest("details:not([open])");if(!n)return e;if(n!==t){const e=t.closest("summary");if(e&&e.parentNode!==n)return!1;if(null===e)return!1}return e},Wt=t=>!t||t.nodeType!==Node.ELEMENT_NODE||(!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled"))),Ht=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?Ht(t.parentNode):null},Ut=()=>{},Kt=t=>{t.offsetHeight},Yt=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,qt=[],Qt=()=>"rtl"===document.documentElement.dir,Xt=t=>{var e;e=()=>{const e=Yt();if(e){const n=t.NAME,i=e.fn[n];e.fn[n]=t.jQueryInterface,e.fn[n].Constructor=t,e.fn[n].noConflict=()=>(e.fn[n]=i,t.jQueryInterface)}},"loading"===document.readyState?(qt.length||document.addEventListener("DOMContentLoaded",(()=>{for(const t of qt)t()})),qt.push(e)):e()},Gt=(t,e=[],n=t)=>"function"==typeof t?t(...e):n,Jt=(t,e,n=!0)=>{if(!n)return void Gt(t);const i=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:n}=window.getComputedStyle(t);const i=Number.parseFloat(e),r=Number.parseFloat(n);return i||r?(e=e.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(n))):0})(e)+5;let r=!1;const s=({target:n})=>{n===e&&(r=!0,e.removeEventListener(Rt,s),Gt(t))};e.addEventListener(Rt,s),setTimeout((()=>{r||jt(e)}),i)},Zt=(t,e,n,i)=>{const r=t.length;let s=t.indexOf(e);return-1===s?!n&&i?t[r-1]:t[0]:(s+=n?1:-1,i&&(s=(s+r)%r),t[Math.max(0,Math.min(s,r-1))])},te=/[^.]*(?=\..*)\.|.*/,ee=/\..*/,ne=/::\d+$/,ie={};let re=1;const se={mouseenter:"mouseover",mouseleave:"mouseout"},oe=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ae(t,e){return e&&`${e}::${re++}`||t.uidEvent||re++}function le(t){const e=ae(t);return t.uidEvent=e,ie[e]=ie[e]||{},ie[e]}function ce(t,e,n=null){return Object.values(t).find((t=>t.callable===e&&t.delegationSelector===n))}function ue(t,e,n){const i="string"==typeof e,r=i?n:e||n;let s=pe(t);return oe.has(s)||(s=t),[i,r,s]}function he(t,e,n,i,r){if("string"!=typeof e||!t)return;let[s,o,a]=ue(e,n,i);if(e in se){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};o=t(o)}const l=le(t),c=l[a]||(l[a]={}),u=ce(c,o,s?n:null);if(u)return void(u.oneOff=u.oneOff&&r);const h=ae(o,e.replace(te,"")),d=s?function(t,e,n){return function i(r){const s=t.querySelectorAll(e);for(let{target:o}=r;o&&o!==this;o=o.parentNode)for(const a of s)if(a===o)return me(r,{delegateTarget:o}),i.oneOff&&ge.off(t,r.type,e,n),n.apply(o,[r])}}(t,n,o):function(t,e){return function n(i){return me(i,{delegateTarget:t}),n.oneOff&&ge.off(t,i.type,e),e.apply(t,[i])}}(t,o);d.delegationSelector=s?n:null,d.callable=o,d.oneOff=r,d.uidEvent=h,c[h]=d,t.addEventListener(a,d,s)}function de(t,e,n,i,r){const s=ce(e[n],i,r);s&&(t.removeEventListener(n,s,Boolean(r)),delete e[n][s.uidEvent])}function fe(t,e,n,i){const r=e[n]||{};for(const[s,o]of Object.entries(r))s.includes(i)&&de(t,e,n,o.callable,o.delegationSelector)}function pe(t){return t=t.replace(ee,""),se[t]||t}const ge={on(t,e,n,i){he(t,e,n,i,!1)},one(t,e,n,i){he(t,e,n,i,!0)},off(t,e,n,i){if("string"!=typeof e||!t)return;const[r,s,o]=ue(e,n,i),a=o!==e,l=le(t),c=l[o]||{},u=e.startsWith(".");if(void 0===s){if(u)for(const n of Object.keys(l))fe(t,l,n,e.slice(1));for(const[n,i]of Object.entries(c)){const r=n.replace(ne,"");a&&!e.includes(r)||de(t,l,o,i.callable,i.delegationSelector)}}else{if(!Object.keys(c).length)return;de(t,l,o,s,r?n:null)}},trigger(t,e,n){if("string"!=typeof e||!t)return null;const i=Yt();let r=null,s=!0,o=!0,a=!1;e!==pe(e)&&i&&(r=i.Event(e,n),i(t).trigger(r),s=!r.isPropagationStopped(),o=!r.isImmediatePropagationStopped(),a=r.isDefaultPrevented());const l=me(new Event(e,{bubbles:s,cancelable:!0}),n);return a&&l.preventDefault(),o&&t.dispatchEvent(l),l.defaultPrevented&&r&&r.preventDefault(),l}};function me(t,e={}){for(const[n,i]of Object.entries(e))try{t[n]=i}catch(e){Object.defineProperty(t,n,{configurable:!0,get:()=>i})}return t}function be(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function ve(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}const ye={setDataAttribute(t,e,n){t.setAttribute(`data-bs-${ve(e)}`,n)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${ve(e)}`)},getDataAttributes(t){if(!t)return{};const e={},n=Object.keys(t.dataset).filter((t=>t.startsWith("bs")&&!t.startsWith("bsConfig")));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),e[n]=be(t.dataset[i])}return e},getDataAttribute:(t,e)=>be(t.getAttribute(`data-bs-${ve(e)}`))};class _e{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const n=$t(e)?ye.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...$t(e)?ye.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,r]of Object.entries(e)){const e=t[i],s=$t(e)?"element":null==(n=e)?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(r).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${r}".`)}var n}}class xe extends _e{constructor(t,e){super(),(t=Bt(t))&&(this._element=t,this._config=this._getConfig(e),Ft.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Ft.remove(this._element,this.constructor.DATA_KEY),ge.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,n=!0){Jt(t,e,n)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Ft.get(Bt(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const we=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let n=t.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),e=n&&"#"!==n?n.trim():null}return e?e.split(",").map((t=>zt(t))).join(","):null},ke={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const n=[];let i=t.parentNode.closest(e);for(;i;)n.push(i),i=i.parentNode.closest(e);return n},prev(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return[n];n=n.previousElementSibling}return[]},next(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return[n];n=n.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(",");return this.find(e,t).filter((t=>!Wt(t)&&Vt(t)))},getSelectorFromElement(t){const e=we(t);return e&&ke.findOne(e)?e:null},getElementFromSelector(t){const e=we(t);return e?ke.findOne(e):null},getMultipleElementsFromSelector(t){const e=we(t);return e?ke.find(e):[]}},Se=(t,e="hide")=>{const n=`click.dismiss${t.EVENT_KEY}`,i=t.NAME;ge.on(document,n,`[data-bs-dismiss="${i}"]`,(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Wt(this))return;const r=ke.getElementFromSelector(this)||this.closest(`.${i}`);t.getOrCreateInstance(r)[e]()}))},Ee=".bs.alert",Oe=`close${Ee}`,Me=`closed${Ee}`;class Ce extends xe{static get NAME(){return"alert"}close(){if(ge.trigger(this._element,Oe).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),ge.trigger(this._element,Me),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=Ce.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}Se(Ce,"close"),Xt(Ce);const Ae='[data-bs-toggle="button"]';class Te extends xe{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=Te.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}ge.on(document,"click.bs.button.data-api",Ae,(t=>{t.preventDefault();const e=t.target.closest(Ae);Te.getOrCreateInstance(e).toggle()})),Xt(Te);const Pe=".bs.swipe",Le=`touchstart${Pe}`,De=`touchmove${Pe}`,Ne=`touchend${Pe}`,Ie=`pointerdown${Pe}`,Fe=`pointerup${Pe}`,Re={endCallback:null,leftCallback:null,rightCallback:null},ze={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class je extends _e{constructor(t,e){super(),this._element=t,t&&je.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Re}static get DefaultType(){return ze}static get NAME(){return"swipe"}dispose(){ge.off(this._element,Pe)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),Gt(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&Gt(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(ge.on(this._element,Ie,(t=>this._start(t))),ge.on(this._element,Fe,(t=>this._end(t))),this._element.classList.add("pointer-event")):(ge.on(this._element,Le,(t=>this._start(t))),ge.on(this._element,De,(t=>this._move(t))),ge.on(this._element,Ne,(t=>this._end(t))))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const $e=".bs.carousel",Be=".data-api",Ve="ArrowLeft",We="ArrowRight",He="next",Ue="prev",Ke="left",Ye="right",qe=`slide${$e}`,Qe=`slid${$e}`,Xe=`keydown${$e}`,Ge=`mouseenter${$e}`,Je=`mouseleave${$e}`,Ze=`dragstart${$e}`,tn=`load${$e}${Be}`,en=`click${$e}${Be}`,nn="carousel",rn="active",sn=".active",on=".carousel-item",an=sn+on,ln={[Ve]:Ye,[We]:Ke},cn={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},un={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class hn extends xe{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ke.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===nn&&this.cycle()}static get Default(){return cn}static get DefaultType(){return un}static get NAME(){return"carousel"}next(){this._slide(He)}nextWhenVisible(){!document.hidden&&Vt(this._element)&&this.next()}prev(){this._slide(Ue)}pause(){this._isSliding&&jt(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?ge.one(this._element,Qe,(()=>this.cycle())):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void ge.one(this._element,Qe,(()=>this.to(t)));const n=this._getItemIndex(this._getActive());if(n===t)return;const i=t>n?He:Ue;this._slide(i,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&ge.on(this._element,Xe,(t=>this._keydown(t))),"hover"===this._config.pause&&(ge.on(this._element,Ge,(()=>this.pause())),ge.on(this._element,Je,(()=>this._maybeEnableCycle()))),this._config.touch&&je.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of ke.find(".carousel-item img",this._element))ge.on(t,Ze,(t=>t.preventDefault()));const t={leftCallback:()=>this._slide(this._directionToOrder(Ke)),rightCallback:()=>this._slide(this._directionToOrder(Ye)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new je(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=ln[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=ke.findOne(sn,this._indicatorsElement);e.classList.remove(rn),e.removeAttribute("aria-current");const n=ke.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);n&&(n.classList.add(rn),n.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const n=this._getActive(),i=t===He,r=e||Zt(this._getItems(),n,i,this._config.wrap);if(r===n)return;const s=this._getItemIndex(r),o=e=>ge.trigger(this._element,e,{relatedTarget:r,direction:this._orderToDirection(t),from:this._getItemIndex(n),to:s});if(o(qe).defaultPrevented)return;if(!n||!r)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(s),this._activeElement=r;const l=i?"carousel-item-start":"carousel-item-end",c=i?"carousel-item-next":"carousel-item-prev";r.classList.add(c),Kt(r),n.classList.add(l),r.classList.add(l);this._queueCallback((()=>{r.classList.remove(l,c),r.classList.add(rn),n.classList.remove(rn,c,l),this._isSliding=!1,o(Qe)}),n,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return ke.findOne(an,this._element)}_getItems(){return ke.find(on,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return Qt()?t===Ke?Ue:He:t===Ke?He:Ue}_orderToDirection(t){return Qt()?t===Ue?Ke:Ye:t===Ue?Ye:Ke}static jQueryInterface(t){return this.each((function(){const e=hn.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)}))}}ge.on(document,en,"[data-bs-slide], [data-bs-slide-to]",(function(t){const e=ke.getElementFromSelector(this);if(!e||!e.classList.contains(nn))return;t.preventDefault();const n=hn.getOrCreateInstance(e),i=this.getAttribute("data-bs-slide-to");return i?(n.to(i),void n._maybeEnableCycle()):"next"===ye.getDataAttribute(this,"slide")?(n.next(),void n._maybeEnableCycle()):(n.prev(),void n._maybeEnableCycle())})),ge.on(window,tn,(()=>{const t=ke.find('[data-bs-ride="carousel"]');for(const e of t)hn.getOrCreateInstance(e)})),Xt(hn);const dn=".bs.collapse",fn=`show${dn}`,pn=`shown${dn}`,gn=`hide${dn}`,mn=`hidden${dn}`,bn=`click${dn}.data-api`,vn="show",yn="collapse",_n="collapsing",xn=`:scope .${yn} .${yn}`,wn='[data-bs-toggle="collapse"]',kn={parent:null,toggle:!0},Sn={parent:"(null|element)",toggle:"boolean"};class En extends xe{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const n=ke.find(wn);for(const t of n){const e=ke.getSelectorFromElement(t),n=ke.find(e).filter((t=>t===this._element));null!==e&&n.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return kn}static get DefaultType(){return Sn}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((t=>t!==this._element)).map((t=>En.getOrCreateInstance(t,{toggle:!1})))),t.length&&t[0]._isTransitioning)return;if(ge.trigger(this._element,fn).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(yn),this._element.classList.add(_n),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(_n),this._element.classList.add(yn,vn),this._element.style[e]="",ge.trigger(this._element,pn)}),this._element,!0),this._element.style[e]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(ge.trigger(this._element,gn).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,Kt(this._element),this._element.classList.add(_n),this._element.classList.remove(yn,vn);for(const t of this._triggerArray){const e=ke.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(_n),this._element.classList.add(yn),ge.trigger(this._element,mn)}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(vn)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=Bt(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(wn);for(const e of t){const t=ke.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=ke.find(xn,this._config.parent);return ke.find(t,this._config.parent).filter((t=>!e.includes(t)))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const n of t)n.classList.toggle("collapsed",!e),n.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each((function(){const n=En.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===n[t])throw new TypeError(`No method named "${t}"`);n[t]()}}))}}ge.on(document,bn,wn,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of ke.getMultipleElementsFromSelector(this))En.getOrCreateInstance(t,{toggle:!1}).toggle()})),Xt(En);const On="dropdown",Mn=".bs.dropdown",Cn=".data-api",An="ArrowUp",Tn="ArrowDown",Pn=`hide${Mn}`,Ln=`hidden${Mn}`,Dn=`show${Mn}`,Nn=`shown${Mn}`,In=`click${Mn}${Cn}`,Fn=`keydown${Mn}${Cn}`,Rn=`keyup${Mn}${Cn}`,zn="show",jn='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',$n=`${jn}.${zn}`,Bn=".dropdown-menu",Vn=Qt()?"top-end":"top-start",Wn=Qt()?"top-start":"top-end",Hn=Qt()?"bottom-end":"bottom-start",Un=Qt()?"bottom-start":"bottom-end",Kn=Qt()?"left-start":"right-start",Yn=Qt()?"right-start":"left-start",qn={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Qn={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Xn extends xe{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=ke.next(this._element,Bn)[0]||ke.prev(this._element,Bn)[0]||ke.findOne(Bn,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return qn}static get DefaultType(){return Qn}static get NAME(){return On}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Wt(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!ge.trigger(this._element,Dn,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))ge.on(t,"mouseover",Ut);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(zn),this._element.classList.add(zn),ge.trigger(this._element,Nn,t)}}hide(){if(Wt(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!ge.trigger(this._element,Pn,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))ge.off(t,"mouseover",Ut);this._popper&&this._popper.destroy(),this._menu.classList.remove(zn),this._element.classList.remove(zn),this._element.setAttribute("aria-expanded","false"),ye.removeDataAttribute(this._menu,"popper"),ge.trigger(this._element,Ln,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!$t(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${On.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===i)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let t=this._element;"parent"===this._config.reference?t=this._parent:$t(this._config.reference)?t=Bt(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=Dt(t,this._menu,e)}_isShown(){return this._menu.classList.contains(zn)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return Kn;if(t.classList.contains("dropstart"))return Yn;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?Wn:Vn:e?Un:Hn}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(ye.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...Gt(this._config.popperConfig,[t])}}_selectMenuItem({key:t,target:e}){const n=ke.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((t=>Vt(t)));n.length&&Zt(n,e,t===Tn,!n.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=Xn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=ke.find($n);for(const n of e){const e=Xn.getInstance(n);if(!e||!1===e._config.autoClose)continue;const i=t.composedPath(),r=i.includes(e._menu);if(i.includes(e._element)||"inside"===e._config.autoClose&&!r||"outside"===e._config.autoClose&&r)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const s={relatedTarget:e._element};"click"===t.type&&(s.clickEvent=t),e._completeHide(s)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),n="Escape"===t.key,i=[An,Tn].includes(t.key);if(!i&&!n)return;if(e&&!n)return;t.preventDefault();const r=this.matches(jn)?this:ke.prev(this,jn)[0]||ke.next(this,jn)[0]||ke.findOne(jn,t.delegateTarget.parentNode),s=Xn.getOrCreateInstance(r);if(i)return t.stopPropagation(),s.show(),void s._selectMenuItem(t);s._isShown()&&(t.stopPropagation(),s.hide(),r.focus())}}ge.on(document,Fn,jn,Xn.dataApiKeydownHandler),ge.on(document,Fn,Bn,Xn.dataApiKeydownHandler),ge.on(document,In,Xn.clearMenus),ge.on(document,Rn,Xn.clearMenus),ge.on(document,In,jn,(function(t){t.preventDefault(),Xn.getOrCreateInstance(this).toggle()})),Xt(Xn);const Gn="backdrop",Jn="show",Zn=`mousedown.bs.${Gn}`,ti={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},ei={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class ni extends _e{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return ti}static get DefaultType(){return ei}static get NAME(){return Gn}show(t){if(!this._config.isVisible)return void Gt(t);this._append();const e=this._getElement();this._config.isAnimated&&Kt(e),e.classList.add(Jn),this._emulateAnimation((()=>{Gt(t)}))}hide(t){this._config.isVisible?(this._getElement().classList.remove(Jn),this._emulateAnimation((()=>{this.dispose(),Gt(t)}))):Gt(t)}dispose(){this._isAppended&&(ge.off(this._element,Zn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Bt(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),ge.on(t,Zn,(()=>{Gt(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(t){Jt(t,this._getElement(),this._config.isAnimated)}}const ii=".bs.focustrap",ri=`focusin${ii}`,si=`keydown.tab${ii}`,oi="backward",ai={autofocus:!0,trapElement:null},li={autofocus:"boolean",trapElement:"element"};class ci extends _e{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ai}static get DefaultType(){return li}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),ge.off(document,ii),ge.on(document,ri,(t=>this._handleFocusin(t))),ge.on(document,si,(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,ge.off(document,ii))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const n=ke.focusableChildren(e);0===n.length?e.focus():this._lastTabNavDirection===oi?n[n.length-1].focus():n[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?oi:"forward")}}const ui=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",hi=".sticky-top",di="padding-right",fi="margin-right";class pi{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,di,(e=>e+t)),this._setElementAttributes(ui,di,(e=>e+t)),this._setElementAttributes(hi,fi,(e=>e-t))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,di),this._resetElementAttributes(ui,di),this._resetElementAttributes(hi,fi)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,n){const i=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+i)return;this._saveInitialAttribute(t,e);const r=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${n(Number.parseFloat(r))}px`)}))}_saveInitialAttribute(t,e){const n=t.style.getPropertyValue(e);n&&ye.setDataAttribute(t,e,n)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const n=ye.getDataAttribute(t,e);null!==n?(ye.removeDataAttribute(t,e),t.style.setProperty(e,n)):t.style.removeProperty(e)}))}_applyManipulationCallback(t,e){if($t(t))e(t);else for(const n of ke.find(t,this._element))e(n)}}const gi=".bs.modal",mi=`hide${gi}`,bi=`hidePrevented${gi}`,vi=`hidden${gi}`,yi=`show${gi}`,_i=`shown${gi}`,xi=`resize${gi}`,wi=`click.dismiss${gi}`,ki=`mousedown.dismiss${gi}`,Si=`keydown.dismiss${gi}`,Ei=`click${gi}.data-api`,Oi="modal-open",Mi="show",Ci="modal-static",Ai={backdrop:!0,focus:!0,keyboard:!0},Ti={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Pi extends xe{constructor(t,e){super(t,e),this._dialog=ke.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new pi,this._addEventListeners()}static get Default(){return Ai}static get DefaultType(){return Ti}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||this._isTransitioning)return;ge.trigger(this._element,yi,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Oi),this._adjustDialog(),this._backdrop.show((()=>this._showElement(t))))}hide(){if(!this._isShown||this._isTransitioning)return;ge.trigger(this._element,mi).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Mi),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated()))}dispose(){ge.off(window,gi),ge.off(this._dialog,gi),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new ni({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ci({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=ke.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),Kt(this._element),this._element.classList.add(Mi);this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,ge.trigger(this._element,_i,{relatedTarget:t})}),this._dialog,this._isAnimated())}_addEventListeners(){ge.on(this._element,Si,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())})),ge.on(window,xi,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),ge.on(this._element,ki,(t=>{ge.one(this._element,wi,(e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Oi),this._resetAdjustments(),this._scrollBar.reset(),ge.trigger(this._element,vi)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(ge.trigger(this._element,bi).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(Ci)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Ci),this._queueCallback((()=>{this._element.classList.remove(Ci),this._queueCallback((()=>{this._element.style.overflowY=e}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),n=e>0;if(n&&!t){const t=Qt()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!n&&t){const t=Qt()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const n=Pi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===n[t])throw new TypeError(`No method named "${t}"`);n[t](e)}}))}}ge.on(document,Ei,'[data-bs-toggle="modal"]',(function(t){const e=ke.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),ge.one(e,yi,(t=>{t.defaultPrevented||ge.one(e,vi,(()=>{Vt(this)&&this.focus()}))}));const n=ke.findOne(".modal.show");n&&Pi.getInstance(n).hide();Pi.getOrCreateInstance(e).toggle(this)})),Se(Pi),Xt(Pi);const Li=".bs.offcanvas",Di=".data-api",Ni=`load${Li}${Di}`,Ii="show",Fi="showing",Ri="hiding",zi=".offcanvas.show",ji=`show${Li}`,$i=`shown${Li}`,Bi=`hide${Li}`,Vi=`hidePrevented${Li}`,Wi=`hidden${Li}`,Hi=`resize${Li}`,Ui=`click${Li}${Di}`,Ki=`keydown.dismiss${Li}`,Yi={backdrop:!0,keyboard:!0,scroll:!1},qi={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Qi extends xe{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Yi}static get DefaultType(){return qi}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown)return;if(ge.trigger(this._element,ji,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new pi).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Fi);this._queueCallback((()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Ii),this._element.classList.remove(Fi),ge.trigger(this._element,$i,{relatedTarget:t})}),this._element,!0)}hide(){if(!this._isShown)return;if(ge.trigger(this._element,Bi).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ri),this._backdrop.hide();this._queueCallback((()=>{this._element.classList.remove(Ii,Ri),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new pi).reset(),ge.trigger(this._element,Wi)}),this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new ni({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():ge.trigger(this._element,Vi)}:null})}_initializeFocusTrap(){return new ci({trapElement:this._element})}_addEventListeners(){ge.on(this._element,Ki,(t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():ge.trigger(this._element,Vi))}))}static jQueryInterface(t){return this.each((function(){const e=Qi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}ge.on(document,Ui,'[data-bs-toggle="offcanvas"]',(function(t){const e=ke.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),Wt(this))return;ge.one(e,Wi,(()=>{Vt(this)&&this.focus()}));const n=ke.findOne(zi);n&&n!==e&&Qi.getInstance(n).hide();Qi.getOrCreateInstance(e).toggle(this)})),ge.on(window,Ni,(()=>{for(const t of ke.find(zi))Qi.getOrCreateInstance(t).show()})),ge.on(window,Hi,(()=>{for(const t of ke.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Qi.getOrCreateInstance(t).hide()})),Se(Qi),Xt(Qi);const Xi={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Gi=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Ji=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Zi=(t,e)=>{const n=t.nodeName.toLowerCase();return e.includes(n)?!Gi.has(n)||Boolean(Ji.test(t.nodeValue)):e.filter((t=>t instanceof RegExp)).some((t=>t.test(n)))};const tr={allowList:Xi,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},er={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},nr={entry:"(string|element|function|null)",selector:"(string|element)"};class ir extends _e{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return tr}static get DefaultType(){return er}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map((t=>this._resolvePossibleFunction(t))).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,n]of Object.entries(this._config.content))this._setContent(t,n,e);const e=t.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&e.classList.add(...n.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,n]of Object.entries(t))super._typeCheckConfig({selector:e,entry:n},nr)}_setContent(t,e,n){const i=ke.findOne(n,t);i&&((e=this._resolvePossibleFunction(e))?$t(e)?this._putElementInTemplate(Bt(e),i):this._config.html?i.innerHTML=this._maybeSanitize(e):i.textContent=e:i.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,n){if(!t.length)return t;if(n&&"function"==typeof n)return n(t);const i=(new window.DOMParser).parseFromString(t,"text/html"),r=[].concat(...i.body.querySelectorAll("*"));for(const t of r){const n=t.nodeName.toLowerCase();if(!Object.keys(e).includes(n)){t.remove();continue}const i=[].concat(...t.attributes),r=[].concat(e["*"]||[],e[n]||[]);for(const e of i)Zi(e,r)||t.removeAttribute(e.nodeName)}return i.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Gt(t,[this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const rr=new Set(["sanitize","allowList","sanitizeFn"]),sr="fade",or="show",ar=".tooltip-inner",lr=".modal",cr="hide.bs.modal",ur="hover",hr="focus",dr={AUTO:"auto",TOP:"top",RIGHT:Qt()?"left":"right",BOTTOM:"bottom",LEFT:Qt()?"right":"left"},fr={allowList:Xi,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},pr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class gr extends xe{constructor(t,e){if(void 0===i)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return fr}static get DefaultType(){return pr}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),ge.off(this._element.closest(lr),cr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=ge.trigger(this._element,this.constructor.eventName("show")),e=(Ht(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:i}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),ge.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(or),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))ge.on(t,"mouseover",Ut);this._queueCallback((()=>{ge.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1}),this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(ge.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(or),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))ge.off(t,"mouseover",Ut);this._activeTrigger.click=!1,this._activeTrigger[hr]=!1,this._activeTrigger[ur]=!1,this._isHovered=null;this._queueCallback((()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),ge.trigger(this._element,this.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(sr,or),e.classList.add(`bs-${this.constructor.NAME}-auto`);const n=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",n),this._isAnimated()&&e.classList.add(sr),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new ir({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[ar]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(sr)}_isShown(){return this.tip&&this.tip.classList.contains(or)}_createPopper(t){const e=Gt(this._config.placement,[this,t,this._element]),n=dr[e.toUpperCase()];return Dt(this._element,t,this._getPopperConfig(n))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return Gt(t,[this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...Gt(this._config.popperConfig,[e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)ge.on(this._element,this.constructor.eventName("click"),this._config.selector,(t=>{this._initializeOnDelegatedTarget(t).toggle()}));else if("manual"!==e){const t=e===ur?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n=e===ur?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");ge.on(this._element,t,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?hr:ur]=!0,e._enter()})),ge.on(this._element,n,this._config.selector,(t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?hr:ur]=e._element.contains(t.relatedTarget),e._leave()}))}this._hideModalHandler=()=>{this._element&&this.hide()},ge.on(this._element.closest(lr),cr,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((()=>{this._isHovered&&this.show()}),this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((()=>{this._isHovered||this.hide()}),this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=ye.getDataAttributes(this._element);for(const t of Object.keys(e))rr.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:Bt(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,n]of Object.entries(this._config))this.constructor.Default[e]!==n&&(t[e]=n);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each((function(){const e=gr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Xt(gr);const mr=".popover-header",br=".popover-body",vr={...gr.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},yr={...gr.DefaultType,content:"(null|string|element|function)"};class _r extends gr{static get Default(){return vr}static get DefaultType(){return yr}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[mr]:this._getTitle(),[br]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each((function(){const e=_r.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}Xt(_r);const xr=".bs.scrollspy",wr=`activate${xr}`,kr=`click${xr}`,Sr=`load${xr}.data-api`,Er="active",Or="[href]",Mr=".nav-link",Cr=`${Mr}, .nav-item > ${Mr}, .list-group-item`,Ar={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Tr={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Pr extends xe{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Ar}static get DefaultType(){return Tr}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Bt(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map((t=>Number.parseFloat(t)))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(ge.off(this._config.target,kr),ge.on(this._config.target,kr,Or,(t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const n=this._rootElement||window,i=e.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:i,behavior:"smooth"});n.scrollTop=i}})))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((t=>this._observerCallback(t)),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),n=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},i=(this._rootElement||document.documentElement).scrollTop,r=i>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=i;for(const s of t){if(!s.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(s));continue}const t=s.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(r&&t){if(n(s),!i)return}else r||t||n(s)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=ke.find(Or,this._config.target);for(const e of t){if(!e.hash||Wt(e))continue;const t=ke.findOne(decodeURI(e.hash),this._element);Vt(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Er),this._activateParents(t),ge.trigger(this._element,wr,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))ke.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(Er);else for(const e of ke.parents(t,".nav, .list-group"))for(const t of ke.prev(e,Cr))t.classList.add(Er)}_clearActiveClass(t){t.classList.remove(Er);const e=ke.find(`${Or}.${Er}`,t);for(const t of e)t.classList.remove(Er)}static jQueryInterface(t){return this.each((function(){const e=Pr.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}ge.on(window,Sr,(()=>{for(const t of ke.find('[data-bs-spy="scroll"]'))Pr.getOrCreateInstance(t)})),Xt(Pr);const Lr=".bs.tab",Dr=`hide${Lr}`,Nr=`hidden${Lr}`,Ir=`show${Lr}`,Fr=`shown${Lr}`,Rr=`click${Lr}`,zr=`keydown${Lr}`,jr=`load${Lr}`,$r="ArrowLeft",Br="ArrowRight",Vr="ArrowUp",Wr="ArrowDown",Hr="Home",Ur="End",Kr="active",Yr="fade",qr="show",Qr=".dropdown-toggle",Xr=`:not(${Qr})`,Gr='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Jr=`${`.nav-link${Xr}, .list-group-item${Xr}, [role="tab"]${Xr}`}, ${Gr}`,Zr=`.${Kr}[data-bs-toggle="tab"], .${Kr}[data-bs-toggle="pill"], .${Kr}[data-bs-toggle="list"]`;class ts extends xe{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),ge.on(this._element,zr,(t=>this._keydown(t))))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),n=e?ge.trigger(e,Dr,{relatedTarget:t}):null;ge.trigger(t,Ir,{relatedTarget:e}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){if(!t)return;t.classList.add(Kr),this._activate(ke.getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),ge.trigger(t,Fr,{relatedTarget:e})):t.classList.add(qr)}),t,t.classList.contains(Yr))}_deactivate(t,e){if(!t)return;t.classList.remove(Kr),t.blur(),this._deactivate(ke.getElementFromSelector(t));this._queueCallback((()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),ge.trigger(t,Nr,{relatedTarget:e})):t.classList.remove(qr)}),t,t.classList.contains(Yr))}_keydown(t){if(![$r,Br,Vr,Wr,Hr,Ur].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter((t=>!Wt(t)));let n;if([Hr,Ur].includes(t.key))n=e[t.key===Hr?0:e.length-1];else{const i=[Br,Wr].includes(t.key);n=Zt(e,t.target,i,!0)}n&&(n.focus({preventScroll:!0}),ts.getOrCreateInstance(n).show())}_getChildren(){return ke.find(Jr,this._parent)}_getActiveElem(){return this._getChildren().find((t=>this._elemIsActive(t)))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),n=this._getOuterElement(t);t.setAttribute("aria-selected",e),n!==t&&this._setAttributeIfNotExists(n,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=ke.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const n=this._getOuterElement(t);if(!n.classList.contains("dropdown"))return;const i=(t,i)=>{const r=ke.findOne(t,n);r&&r.classList.toggle(i,e)};i(Qr,Kr),i(".dropdown-menu",qr),n.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,n){t.hasAttribute(e)||t.setAttribute(e,n)}_elemIsActive(t){return t.classList.contains(Kr)}_getInnerElement(t){return t.matches(Jr)?t:ke.findOne(Jr,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each((function(){const e=ts.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}))}}ge.on(document,Rr,Gr,(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),Wt(this)||ts.getOrCreateInstance(this).show()})),ge.on(window,jr,(()=>{for(const t of ke.find(Zr))ts.getOrCreateInstance(t)})),Xt(ts);const es=".bs.toast",ns=`mouseover${es}`,is=`mouseout${es}`,rs=`focusin${es}`,ss=`focusout${es}`,os=`hide${es}`,as=`hidden${es}`,ls=`show${es}`,cs=`shown${es}`,us="hide",hs="show",ds="showing",fs={animation:"boolean",autohide:"boolean",delay:"number"},ps={animation:!0,autohide:!0,delay:5e3};class gs extends xe{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return ps}static get DefaultType(){return fs}static get NAME(){return"toast"}show(){if(ge.trigger(this._element,ls).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(us),Kt(this._element),this._element.classList.add(hs,ds),this._queueCallback((()=>{this._element.classList.remove(ds),ge.trigger(this._element,cs),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(ge.trigger(this._element,os).defaultPrevented)return;this._element.classList.add(ds),this._queueCallback((()=>{this._element.classList.add(us),this._element.classList.remove(ds,hs),ge.trigger(this._element,as)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(hs),super.dispose()}isShown(){return this._element.classList.contains(hs)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const n=t.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){ge.on(this._element,ns,(t=>this._onInteraction(t,!0))),ge.on(this._element,is,(t=>this._onInteraction(t,!1))),ge.on(this._element,rs,(t=>this._onInteraction(t,!0))),ge.on(this._element,ss,(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=gs.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}Se(gs),Xt(gs)},2551:(t,e,n)=>{var i=n(6540),r=n(9982);function s(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n