UNPKG

highcharts

Version:
10 lines 159 kB
/** * Highcharts JS v11.3.0 (2024-01-10) * * Accessibility module * * (c) 2010-2024 Highsoft AS * Author: Oystein Moseng * * License: www.highcharts.com/license */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/accessibility",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(t,e,i,s){t.hasOwnProperty(e)||(t[e]=s.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Accessibility/Utils/HTMLUtilities.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{doc:i,win:s}=t,{css:n}=e,o=s.EventTarget&&new s.EventTarget||"none";function r(t){if("function"==typeof s.MouseEvent)return new s.MouseEvent(t.type,t);if(i.createEvent){let e=i.createEvent("MouseEvent");if(e.initMouseEvent)return e.initMouseEvent(t.type,t.bubbles,t.cancelable,t.view||s,t.detail,t.screenX,t.screenY,t.clientX,t.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget),e}return a(t.type)}function a(t,e,n){let r=e||{x:0,y:0};if("function"==typeof s.MouseEvent)return new s.MouseEvent(t,{bubbles:!0,cancelable:!0,composed:!0,button:0,buttons:1,relatedTarget:n||o,view:s,detail:"click"===t?1:0,screenX:r.x,screenY:r.y,clientX:r.x,clientY:r.y});if(i.createEvent){let e=i.createEvent("MouseEvent");if(e.initMouseEvent)return e.initMouseEvent(t,!0,!0,s,"click"===t?1:0,r.x,r.y,r.x,r.y,!1,!1,!1,!1,0,null),e}return{type:t}}return{addClass:function(t,e){t.classList?t.classList.add(e):0>t.className.indexOf(e)&&(t.className+=" "+e)},cloneMouseEvent:r,cloneTouchEvent:function(t){let e=t=>{let e=[];for(let i=0;i<t.length;++i){let s=t.item(i);s&&e.push(s)}return e};if("function"==typeof s.TouchEvent){let i=new s.TouchEvent(t.type,{touches:e(t.touches),targetTouches:e(t.targetTouches),changedTouches:e(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view});return t.defaultPrevented&&i.preventDefault(),i}let i=r(t);return i.touches=t.touches,i.changedTouches=t.changedTouches,i.targetTouches=t.targetTouches,i},escapeStringForHTML:function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")},getElement:function(t){return i.getElementById(t)},getFakeMouseEvent:a,getHeadingTagNameForElement:function(t){let e=t=>{let e=parseInt(t.slice(1),10);return"h"+Math.min(6,e+1)},i=t=>/H[1-6]/.test(t),s=t=>{let e=t;for(;e=e.previousSibling;){let t=e.tagName||"";if(i(t))return t}return""},n=t=>{let o=s(t);if(o)return e(o);let r=t.parentElement;if(!r)return"p";let a=r.tagName;return i(a)?e(a):n(r)};return n(t)},removeChildNodes:function(t){for(;t.lastChild;)t.removeChild(t.lastChild)},removeClass:function(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(RegExp(e,"g"),"")},removeElement:function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},reverseChildNodes:function(t){let e=t.childNodes.length;for(;e--;)t.appendChild(t.childNodes[e])},simulatedEventTarget:o,stripHTMLTagsFromString:function(t,e=!1){return"string"==typeof t?e?t.replace(/<\/?[^>]+(>|$)/g,""):t.replace(/<\/?(?!\s)[^>]+(>|$)/g,""):t},visuallyHideElement:function(t){n(t,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(1px, 1px, 1px, 1px)",marginTop:"-3px","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)",filter:"alpha(opacity=1)",opacity:.01})}}}),i(e,"Accessibility/A11yI18n.js",[e["Core/Templating.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i){var s;let{format:n}=t,{composed:o}=e,{getNestedProperty:r,pick:a,pushUnique:l}=i;return function(t){function e(t,e,i){let s=(t,e)=>{let i=t.slice(e||0),s=i.indexOf("{"),n=i.indexOf("}");if(s>-1&&n>s)return{statement:i.substring(s+1,n),begin:e+s+1,end:e+n}},o=[],l,h,c=0;do l=s(t,c),(h=t.substring(c,l&&l.begin-1)).length&&o.push({value:h,type:"constant"}),l&&o.push({value:l.statement,type:"statement"}),c=l?l.end+1:c+1;while(l);return o.forEach(t=>{"statement"===t.type&&(t.value=function(t,e){let i,s;let n=t.indexOf("#each("),o=t.indexOf("#plural("),l=t.indexOf("["),h=t.indexOf("]");if(n>-1){let o=t.slice(n).indexOf(")")+n,a=t.substring(0,n),l=t.substring(o+1),h=t.substring(n+6,o),c=h.split(","),d=Number(c[1]),u;if(s="",i=r(c[0],e)){u=(d=isNaN(d)?i.length:d)<0?i.length+d:Math.min(d,i.length);for(let t=0;t<u;++t)s+=a+i[t]+l}return s.length?s:""}if(o>-1){var c;let i=t.slice(o).indexOf(")")+o,n=t.substring(o+8,i),l=n.split(","),h=Number(r(l[0],e));switch(h){case 0:s=a(l[4],l[1]);break;case 1:s=a(l[2],l[1]);break;case 2:s=a(l[3],l[1]);break;default:s=l[1]}return s?(c=s).trim&&c.trim()||c.replace(/^\s+|\s+$/g,""):""}if(l>-1){let s;let n=t.substring(0,l),o=Number(t.substring(l+1,h));return i=r(n,e),!isNaN(o)&&i&&(o<0?void 0===(s=i[i.length+o])&&(s=i[0]):void 0===(s=i[o])&&(s=i[i.length-1])),void 0!==s?s:""}return"{"+t+"}"}(t.value,e))}),n(o.reduce((t,e)=>t+e.value,""),e,i)}function i(t,i){let s=t.split("."),n=this.options.lang,o=0;for(;o<s.length;++o)n=n&&n[s[o]];return"string"==typeof n?e(n,i,this):""}t.compose=function t(e){if(l(o,t)){let t=e.prototype;t.langFormat=i}},t.i18nFormat=e}(s||(s={})),s}),i(e,"Accessibility/Utils/ChartUtilities.js",[e["Core/Globals.js"],e["Accessibility/Utils/HTMLUtilities.js"],e["Core/Utilities.js"]],function(t,e,i){let{doc:s}=t,{stripHTMLTagsFromString:n}=e,{defined:o,find:r,fireEvent:a}=i;function l(t){if(t.points&&t.points.length){let e=r(t.points,t=>!!t.graphic);return e&&e.graphic&&e.graphic.element}}function h(t){let e=l(t);return e&&e.parentNode||t.graph&&t.graph.element||t.group&&t.group.element}return{fireEventOnWrappedOrUnwrappedElement:function t(e,i){let n=i.type,o=e.hcEvents;s.createEvent&&(e.dispatchEvent||e.fireEvent)?e.dispatchEvent?e.dispatchEvent(i):e.fireEvent(n,i):o&&o[n]?a(e,n,i):e.element&&t(e.element,i)},getChartTitle:function(t){return n(t.options.title.text||t.langFormat("accessibility.defaultChartTitle",{chart:t}),t.renderer.forExport)},getAxisDescription:function(t){return t&&(t.options.accessibility?.description||t.axisTitle?.textStr||t.options.id||t.categories&&"categories"||t.dateTime&&"Time"||"values")},getAxisRangeDescription:function(t){let e=t.options||{};return e.accessibility&&void 0!==e.accessibility.rangeDescription?e.accessibility.rangeDescription:t.categories?function(t){let e=t.chart;return t.dataMax&&t.dataMin?e.langFormat("accessibility.axis.rangeCategories",{chart:e,axis:t,numCategories:t.dataMax-t.dataMin+1}):""}(t):t.dateTime&&(0===t.min||0===t.dataMin)?function(t){let e=t.chart,i={},s=t.dataMin||t.min||0,n=t.dataMax||t.max||0,o="Seconds";i.Seconds=(n-s)/1e3,i.Minutes=i.Seconds/60,i.Hours=i.Minutes/60,i.Days=i.Hours/24,["Minutes","Hours","Days"].forEach(function(t){i[t]>2&&(o=t)});let r=i[o].toFixed("Seconds"!==o&&"Minutes"!==o?1:0);return e.langFormat("accessibility.axis.timeRange"+o,{chart:e,axis:t,range:r.replace(".0","")})}(t):function(t){let e=t.chart,i=e.options,s=i&&i.accessibility&&i.accessibility.screenReaderSection.axisRangeDateFormat||"",n={min:t.dataMin||t.min||0,max:t.dataMax||t.max||0},o=function(i){return t.dateTime?e.time.dateFormat(s,n[i]):n[i].toString()};return e.langFormat("accessibility.axis.rangeFromTo",{chart:e,axis:t,rangeFrom:o("min"),rangeTo:o("max")})}(t)},getPointFromXY:function(t,e,i){let s=t.length,n;for(;s--;)if(n=r(t[s].points||[],function(t){return t.x===e&&t.y===i}))return n},getSeriesFirstPointElement:l,getSeriesFromName:function(t,e){return e?(t.series||[]).filter(function(t){return t.name===e}):t.series},getSeriesA11yElement:h,unhideChartElementFromAT:function t(e,i){i.setAttribute("aria-hidden",!1),i!==e.renderTo&&i.parentNode&&i.parentNode!==s.body&&(Array.prototype.forEach.call(i.parentNode.childNodes,function(t){t.hasAttribute("aria-hidden")||t.setAttribute("aria-hidden",!0)}),t(e,i.parentNode))},hideSeriesFromAT:function(t){let e=h(t);e&&e.setAttribute("aria-hidden",!0)},scrollAxisToPoint:function(t){let e=t.series.xAxis,i=t.series.yAxis,s=e&&e.scrollbar?e:i,n=s&&s.scrollbar;if(n&&o(n.to)&&o(n.from)){let e=n.to-n.from,i=function(t,e){if(!o(t.dataMin)||!o(t.dataMax))return 0;let i=t.toPixels(t.dataMin),s=t.toPixels(t.dataMax),n="xAxis"===t.coll?"x":"y",r=t.toPixels(e[n]||0);return(r-i)/(s-i)}(s,t);n.updatePosition(i-e/2,i+e/2),a(n,"changed",{from:n.from,to:n.to,trigger:"scrollbar",DOMEvent:null})}}}}),i(e,"Accessibility/Utils/DOMElementProvider.js",[e["Core/Globals.js"],e["Accessibility/Utils/HTMLUtilities.js"]],function(t,e){let{doc:i}=t,{removeElement:s}=e;return class{constructor(){this.elements=[]}createElement(){let t=i.createElement.apply(i,arguments);return this.elements.push(t),t}destroyCreatedElements(){this.elements.forEach(function(t){s(t)}),this.elements=[]}}}),i(e,"Accessibility/Utils/EventProvider.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{addEvent:i}=e;return class{constructor(){this.eventRemovers=[]}addEvent(){let e=i.apply(t,arguments);return this.eventRemovers.push(e),e}removeAddedEvents(){this.eventRemovers.forEach(t=>t()),this.eventRemovers=[]}}}),i(e,"Accessibility/AccessibilityComponent.js",[e["Accessibility/Utils/ChartUtilities.js"],e["Accessibility/Utils/DOMElementProvider.js"],e["Accessibility/Utils/EventProvider.js"],e["Accessibility/Utils/HTMLUtilities.js"],e["Core/Utilities.js"]],function(t,e,i,s,n){let{fireEventOnWrappedOrUnwrappedElement:o}=t,{getFakeMouseEvent:r}=s,{extend:a}=n;class l{initBase(t,s){this.chart=t,this.eventProvider=new i,this.domElementProvider=new e,this.proxyProvider=s,this.keyCodes={left:37,right:39,up:38,down:40,enter:13,space:32,esc:27,tab:9,pageUp:33,pageDown:34,end:35,home:36}}addEvent(t,e,i,s){return this.eventProvider.addEvent(t,e,i,s)}createElement(t,e){return this.domElementProvider.createElement(t,e)}fakeClickEvent(t){let e=r("click");o(t,e)}destroyBase(){this.domElementProvider.destroyCreatedElements(),this.eventProvider.removeAddedEvents()}}return a(l.prototype,{init(){},getKeyboardNavigation:function(){},onChartUpdate(){},onChartRender(){},destroy(){}}),l}),i(e,"Accessibility/KeyboardNavigationHandler.js",[e["Core/Utilities.js"]],function(t){let{find:e}=t;return class{constructor(t,e){this.chart=t,this.keyCodeMap=e.keyCodeMap||[],this.validate=e.validate,this.init=e.init,this.terminate=e.terminate,this.response={success:1,prev:2,next:3,noHandler:4,fail:5}}run(t){let i=t.which||t.keyCode,s=this.response.noHandler,n=e(this.keyCodeMap,function(t){return t[0].indexOf(i)>-1});return n?s=n[1].call(this,i,t):9===i&&(s=this.response[t.shiftKey?"prev":"next"]),s}}}),i(e,"Accessibility/Components/ContainerComponent.js",[e["Accessibility/AccessibilityComponent.js"],e["Accessibility/KeyboardNavigationHandler.js"],e["Accessibility/Utils/ChartUtilities.js"],e["Core/Globals.js"],e["Accessibility/Utils/HTMLUtilities.js"]],function(t,e,i,s,n){let{unhideChartElementFromAT:o,getChartTitle:r}=i,{doc:a}=s,{stripHTMLTagsFromString:l}=n;return class extends t{onChartUpdate(){this.handleSVGTitleElement(),this.setSVGContainerLabel(),this.setGraphicContainerAttrs(),this.setRenderToAttrs(),this.makeCreditsAccessible()}handleSVGTitleElement(){let t=this.chart,e="highcharts-title-"+t.index,i=l(t.langFormat("accessibility.svgContainerTitle",{chartTitle:r(t)}));if(i.length){let s=this.svgTitleElement=this.svgTitleElement||a.createElementNS("http://www.w3.org/2000/svg","title");s.textContent=i,s.id=e,t.renderTo.insertBefore(s,t.renderTo.firstChild)}}setSVGContainerLabel(){let t=this.chart,e=t.langFormat("accessibility.svgContainerLabel",{chartTitle:r(t)});t.renderer.box&&e.length&&t.renderer.box.setAttribute("aria-label",e)}setGraphicContainerAttrs(){let t=this.chart,e=t.langFormat("accessibility.graphicContainerLabel",{chartTitle:r(t)});e.length&&t.container.setAttribute("aria-label",e)}setRenderToAttrs(){let t=this.chart,e="disabled"!==t.options.accessibility.landmarkVerbosity,i=t.langFormat("accessibility.chartContainerLabel",{title:r(t),chart:t});i&&(t.renderTo.setAttribute("role",e?"region":"group"),t.renderTo.setAttribute("aria-label",i))}makeCreditsAccessible(){let t=this.chart,e=t.credits;e&&(e.textStr&&e.element.setAttribute("aria-label",t.langFormat("accessibility.credits",{creditsStr:l(e.textStr,t.renderer.forExport)})),o(t,e.element))}getKeyboardNavigation(){let t=this.chart;return new e(t,{keyCodeMap:[],validate:function(){return!0},init:function(){let e=t.accessibility;e&&e.keyboardNavigation.tabindexContainer.focus()}})}destroy(){this.chart.renderTo.setAttribute("aria-hidden",!0)}}}),i(e,"Accessibility/FocusBorder.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){var i;let{composed:s}=t,{addEvent:n,pick:o,pushUnique:r}=e;return function(t){let e=["x","y","transform","width","height","r","d","stroke-width"];function i(){let t=this.focusElement,e=this.options.accessibility.keyboardNavigation.focusBorder;t&&(t.removeFocusBorder(),e.enabled&&t.addFocusBorder(e.margin,{stroke:e.style.color,strokeWidth:e.style.lineWidth,r:e.style.borderRadius}))}function a(t,e){let i=this.options.accessibility.keyboardNavigation.focusBorder,s=e||t.element;s&&s.focus&&(s.hcEvents&&s.hcEvents.focusin||n(s,"focusin",function(){}),s.focus(),i.hideBrowserFocusOutline&&(s.style.outline="none")),this.focusElement&&this.focusElement.removeFocusBorder(),this.focusElement=t,this.renderFocusBorder()}function l(t,i){this.focusBorder&&this.removeFocusBorder();let s=this.getBBox(),n=o(t,3),r=this.parentGroup,a=this.scaleX||r&&r.scaleX,l=this.scaleY||r&&r.scaleY,h=a?!l:l,c=h?Math.abs(a||l||1):(Math.abs(a||1)+Math.abs(l||1))/2;s.x+=this.translateX?this.translateX:0,s.y+=this.translateY?this.translateY:0;let d=s.x-n,u=s.y-n,p=s.width+2*n,g=s.height+2*n,m=!!this.text;if("text"===this.element.nodeName||m){let t,e;let i=!!this.rotation,o=m?{x:i?1:0,y:0}:(t=0,e=0,"middle"===this.attr("text-anchor")?t=e=.5:this.rotation?t=.25:e=.75,{x:t,y:e}),r=+this.attr("x"),a=+this.attr("y");if(isNaN(r)||(d=r-s.width*o.x-n),isNaN(a)||(u=a-s.height*o.y-n),m&&i){let t=p;p=g,g=t,isNaN(r)||(d=r-s.height*o.x-n),isNaN(a)||(u=a-s.width*o.y-n)}}this.focusBorder=this.renderer.rect(d,u,p,g,parseInt((i&&i.r||0).toString(),10)/c).addClass("highcharts-focus-border").attr({zIndex:99}).add(r),this.renderer.styledMode||this.focusBorder.attr({stroke:i&&i.stroke,"stroke-width":(i&&i.strokeWidth||0)/c}),function(t,...i){t.focusBorderUpdateHooks||(t.focusBorderUpdateHooks={},e.forEach(e=>{let s=e+"Setter",n=t[s]||t._defaultSetter;t.focusBorderUpdateHooks[s]=n,t[s]=function(){let e=n.apply(t,arguments);return t.addFocusBorder.apply(t,i),e}}))}(this,t,i),function(t){if(t.focusBorderDestroyHook)return;let e=t.destroy;t.destroy=function(){return t.focusBorder&&t.focusBorder.destroy&&t.focusBorder.destroy(),e.apply(t,arguments)},t.focusBorderDestroyHook=e}(this)}function h(){var t;t=this,t.focusBorderUpdateHooks&&(Object.keys(t.focusBorderUpdateHooks).forEach(e=>{let i=t.focusBorderUpdateHooks[e];i===t._defaultSetter?delete t[e]:t[e]=i}),delete t.focusBorderUpdateHooks),this.focusBorderDestroyHook&&(this.destroy=this.focusBorderDestroyHook,delete this.focusBorderDestroyHook),this.focusBorder&&(this.focusBorder.destroy(),delete this.focusBorder)}t.compose=function t(e,n){if(r(s,t)){let t=e.prototype,s=n.prototype;t.renderFocusBorder=i,t.setFocusToElement=a,s.addFocusBorder=l,s.removeFocusBorder=h}}}(i||(i={})),i}),i(e,"Accessibility/Utils/Announcer.js",[e["Core/Renderer/HTML/AST.js"],e["Accessibility/Utils/DOMElementProvider.js"],e["Core/Globals.js"],e["Accessibility/Utils/HTMLUtilities.js"],e["Core/Utilities.js"]],function(t,e,i,s,n){let{doc:o}=i,{addClass:r,visuallyHideElement:a}=s,{attr:l}=n;return class{constructor(t,i){this.chart=t,this.domElementProvider=new e,this.announceRegion=this.addAnnounceRegion(i)}destroy(){this.domElementProvider.destroyCreatedElements()}announce(e){t.setElementHTML(this.announceRegion,e),this.clearAnnouncementRegionTimer&&clearTimeout(this.clearAnnouncementRegionTimer),this.clearAnnouncementRegionTimer=setTimeout(()=>{this.announceRegion.innerHTML=t.emptyHTML,delete this.clearAnnouncementRegionTimer},3e3)}addAnnounceRegion(t){let e=this.chart.announcerContainer||this.createAnnouncerContainer(),i=this.domElementProvider.createElement("div");return l(i,{"aria-hidden":!1,"aria-live":t,"aria-atomic":!0}),this.chart.styledMode?r(i,"highcharts-visually-hidden"):a(i),e.appendChild(i),i}createAnnouncerContainer(){let t=this.chart,e=o.createElement("div");return l(e,{"aria-hidden":!1,class:"highcharts-announcer-container"}),e.style.position="relative",t.renderTo.insertBefore(e,t.renderTo.firstChild),t.announcerContainer=e,e}}}),i(e,"Accessibility/Components/AnnotationsA11y.js",[e["Accessibility/Utils/HTMLUtilities.js"]],function(t){let{escapeStringForHTML:e,stripHTMLTagsFromString:i}=t;function s(t){let e=t.annotations||[];return e.reduce((t,e)=>(e.options&&!1!==e.options.visible&&(t=t.concat(e.labels)),t),[])}function n(t){return t.options&&t.options.accessibility&&t.options.accessibility.description||t.graphic&&t.graphic.text&&t.graphic.text.textStr||""}function o(t){let e=t.options&&t.options.accessibility&&t.options.accessibility.description;if(e)return e;let i=t.chart,s=n(t),o=t.points,r=t=>t.graphic&&t.graphic.element&&t.graphic.element.getAttribute("aria-label")||"",a=o.filter(t=>!!t.graphic).map(t=>{let e=t.accessibility&&t.accessibility.valueDescription||r(t),i=t&&t.series.name||"";return(i?i+", ":"")+"data point "+e}).filter(t=>!!t),l=a.length,h=l>1?"MultiplePoints":l?"SinglePoint":"NoPoints",c={annotationText:s,annotation:t,numPoints:l,annotationPoint:a[0],additionalAnnotationPoints:a.slice(1)};return i.langFormat("accessibility.screenReaderSection.annotations.description"+h,c)}function r(t){let n=s(t);return n.map(s=>{let n=e(i(o(s),t.renderer.forExport));return n?`<li>${n}</li>`:""})}return{getAnnotationsInfoHTML:function(t){let e=t.annotations;if(!(e&&e.length))return"";let i=r(t);return`<ul style="list-style-type: none">${i.join(" ")}</ul>`},getAnnotationLabelDescription:o,getAnnotationListItems:r,getPointAnnotationTexts:function(t){let e=s(t.series.chart),i=e.filter(e=>e.points.indexOf(t)>-1);return i.length?i.map(t=>`${n(t)}`):[]}}}),i(e,"Accessibility/Components/InfoRegionsComponent.js",[e["Accessibility/A11yI18n.js"],e["Accessibility/AccessibilityComponent.js"],e["Accessibility/Utils/Announcer.js"],e["Accessibility/Components/AnnotationsA11y.js"],e["Core/Renderer/HTML/AST.js"],e["Accessibility/Utils/ChartUtilities.js"],e["Core/Templating.js"],e["Core/Globals.js"],e["Accessibility/Utils/HTMLUtilities.js"],e["Core/Utilities.js"]],function(t,e,i,s,n,o,r,a,l,h){let{getAnnotationsInfoHTML:c}=s,{getAxisDescription:d,getAxisRangeDescription:u,getChartTitle:p,unhideChartElementFromAT:g}=o,{format:m}=r,{doc:b}=a,{addClass:f,getElement:x,getHeadingTagNameForElement:y,stripHTMLTagsFromString:v,visuallyHideElement:A}=l,{attr:w,pick:C}=h;function E(t){return t.replace(/<(\w+)[^>]*?>\s*<\/\1>/g,"")}return class extends e{constructor(){super(...arguments),this.screenReaderSections={}}init(){let t=this.chart,e=this;this.initRegionsDefinitions(),this.addEvent(t,"aftergetTableAST",function(t){e.onDataTableCreated(t)}),this.addEvent(t,"afterViewData",function(t){t.wasHidden&&(e.dataTableDiv=t.element,setTimeout(function(){e.focusDataTable()},300))}),this.addEvent(t,"afterHideData",function(){e.viewDataTableButton&&e.viewDataTableButton.setAttribute("aria-expanded","false")}),this.announcer=new i(t,"assertive")}initRegionsDefinitions(){let t=this,e=this.chart.options.accessibility;this.screenReaderSections={before:{element:null,buildContent:function(i){let s=e.screenReaderSection.beforeChartFormatter;return s?s(i):t.defaultBeforeChartFormatter(i)},insertIntoDOM:function(t,e){e.renderTo.insertBefore(t,e.renderTo.firstChild)},afterInserted:function(){void 0!==t.sonifyButtonId&&t.initSonifyButton(t.sonifyButtonId),void 0!==t.dataTableButtonId&&t.initDataTableButton(t.dataTableButtonId)}},after:{element:null,buildContent:function(i){let s=e.screenReaderSection.afterChartFormatter;return s?s(i):t.defaultAfterChartFormatter()},insertIntoDOM:function(t,e){e.renderTo.insertBefore(t,e.container.nextSibling)},afterInserted:function(){t.chart.accessibility&&e.keyboardNavigation.enabled&&t.chart.accessibility.keyboardNavigation.updateExitAnchor()}}}}onChartRender(){let t=this;this.linkedDescriptionElement=this.getLinkedDescriptionElement(),this.setLinkedDescriptionAttrs(),Object.keys(this.screenReaderSections).forEach(function(e){t.updateScreenReaderSection(e)})}getLinkedDescriptionElement(){let t=this.chart.options,e=t.accessibility.linkedDescription;if(!e)return;if("string"!=typeof e)return e;let i=m(e,this.chart),s=b.querySelectorAll(i);if(1===s.length)return s[0]}setLinkedDescriptionAttrs(){let t=this.linkedDescriptionElement;t&&(t.setAttribute("aria-hidden","true"),f(t,"highcharts-linked-description"))}updateScreenReaderSection(t){let e=this.chart,i=this.screenReaderSections[t],s=i.buildContent(e),o=i.element=i.element||this.createElement("div"),r=o.firstChild||this.createElement("div");s?(this.setScreenReaderSectionAttribs(o,t),n.setElementHTML(r,s),o.appendChild(r),i.insertIntoDOM(o,e),e.styledMode?f(r,"highcharts-visually-hidden"):A(r),g(e,r),i.afterInserted&&i.afterInserted()):(o.parentNode&&o.parentNode.removeChild(o),i.element=null)}setScreenReaderSectionAttribs(t,e){let i=this.chart,s=i.langFormat("accessibility.screenReaderSection."+e+"RegionLabel",{chart:i,chartTitle:p(i)}),n=`highcharts-screen-reader-region-${e}-${i.index}`;w(t,{id:n,"aria-label":s||void 0}),t.style.position="relative",s&&t.setAttribute("role","all"===i.options.accessibility.landmarkVerbosity?"region":"group")}defaultBeforeChartFormatter(){let e=this.chart,i=e.options.accessibility.screenReaderSection.beforeChartFormat;if(!i)return"";let s=this.getAxesDescription(),n=e.sonify&&e.options.sonification&&e.options.sonification.enabled,o="highcharts-a11y-sonify-data-btn-"+e.index,r="hc-linkto-highcharts-data-table-"+e.index,a=c(e),l=e.langFormat("accessibility.screenReaderSection.annotations.heading",{chart:e}),h={headingTagName:y(e.renderTo),chartTitle:p(e),typeDescription:this.getTypeDescriptionText(),chartSubtitle:this.getSubtitleText(),chartLongdesc:this.getLongdescText(),xAxisDescription:s.xAxis,yAxisDescription:s.yAxis,playAsSoundButton:n?this.getSonifyButtonText(o):"",viewTableButton:e.getCSV?this.getDataTableButtonText(r):"",annotationsTitle:a?l:"",annotationsList:a},d=t.i18nFormat(i,h,e);return this.dataTableButtonId=r,this.sonifyButtonId=o,E(d)}defaultAfterChartFormatter(){let e=this.chart,i=e.options.accessibility.screenReaderSection.afterChartFormat;if(!i)return"";let s={endOfChartMarker:this.getEndOfChartMarkerText()},n=t.i18nFormat(i,s,e);return E(n)}getLinkedDescription(){let t=this.linkedDescriptionElement,e=t&&t.innerHTML||"";return v(e,this.chart.renderer.forExport)}getLongdescText(){let t=this.chart.options,e=t.caption,i=e&&e.text,s=this.getLinkedDescription();return t.accessibility.description||s||i||""}getTypeDescriptionText(){let t=this.chart;return t.types?t.options.accessibility.typeDescription||function(t,e){let i=e[0],s=t.series&&t.series[0]||{},n=t.mapView&&t.mapView.geoMap&&t.mapView.geoMap.title,o={numSeries:t.series.length,numPoints:s.points&&s.points.length,chart:t,mapTitle:n};return i?"map"===i||"tiledwebmap"===i?o.mapTitle?t.langFormat("accessibility.chartTypes.mapTypeDescription",o):t.langFormat("accessibility.chartTypes.unknownMap",o):t.types.length>1?t.langFormat("accessibility.chartTypes.combinationChart",o):function(t,e,i){let s=e[0],n=t.langFormat("accessibility.seriesTypeDescriptions."+s,i),o=t.series&&t.series.length<2?"Single":"Multiple";return(t.langFormat("accessibility.chartTypes."+s+o,i)||t.langFormat("accessibility.chartTypes.default"+o,i))+(n?" "+n:"")}(t,e,o):t.langFormat("accessibility.chartTypes.emptyChart",o)}(t,t.types):""}getDataTableButtonText(t){let e=this.chart,i=e.langFormat("accessibility.table.viewAsDataTableButtonText",{chart:e,chartTitle:p(e)});return'<button id="'+t+'">'+i+"</button>"}getSonifyButtonText(t){let e=this.chart;if(e.options.sonification&&!1===e.options.sonification.enabled)return"";let i=e.langFormat("accessibility.sonification.playAsSoundButtonText",{chart:e,chartTitle:p(e)});return'<button id="'+t+'">'+i+"</button>"}getSubtitleText(){let t=this.chart.options.subtitle;return v(t&&t.text||"",this.chart.renderer.forExport)}getEndOfChartMarkerText(){let t=this.chart,e=t.langFormat("accessibility.screenReaderSection.endOfChartMarker",{chart:t}),i="highcharts-end-of-chart-marker-"+t.index;return'<div id="'+i+'">'+e+"</div>"}onDataTableCreated(t){let e=this.chart;if(e.options.accessibility.enabled){this.viewDataTableButton&&this.viewDataTableButton.setAttribute("aria-expanded","true");let i=t.tree.attributes||{};i.tabindex=-1,i.summary=e.langFormat("accessibility.table.tableSummary",{chart:e}),t.tree.attributes=i}}focusDataTable(){let t=this.dataTableDiv,e=t&&t.getElementsByTagName("table")[0];e&&e.focus&&e.focus()}initSonifyButton(t){let e=this.sonifyButton=x(t),i=this.chart,s=t=>{e&&(e.setAttribute("aria-hidden","true"),e.setAttribute("aria-label","")),t.preventDefault(),t.stopPropagation();let s=i.langFormat("accessibility.sonification.playAsSoundClickAnnouncement",{chart:i});this.announcer.announce(s),setTimeout(()=>{e&&(e.removeAttribute("aria-hidden"),e.removeAttribute("aria-label")),i.sonify&&i.sonify()},1e3)};e&&i&&(e.setAttribute("tabindex",-1),e.onclick=function(t){let e=i.options.accessibility&&i.options.accessibility.screenReaderSection.onPlayAsSoundClick;(e||s).call(this,t,i)})}initDataTableButton(t){let e=this.viewDataTableButton=x(t),i=this.chart,s=t.replace("hc-linkto-","");e&&(w(e,{tabindex:-1,"aria-expanded":!!x(s)}),e.onclick=i.options.accessibility.screenReaderSection.onViewDataTableClick||function(){i.viewData()})}getAxesDescription(){let t=this.chart,e=function(e,i){let s=t[e];return s.length>1||s[0]&&C(s[0].options.accessibility&&s[0].options.accessibility.enabled,i)},i=!!t.types&&0>t.types.indexOf("map")&&0>t.types.indexOf("treemap")&&0>t.types.indexOf("tilemap"),s=!!t.hasCartesianSeries,n=e("xAxis",!t.angular&&s&&i),o=e("yAxis",s&&i),r={};return n&&(r.xAxis=this.getAxisDescriptionText("xAxis")),o&&(r.yAxis=this.getAxisDescriptionText("yAxis")),r}getAxisDescriptionText(t){let e=this.chart,i=e[t];return e.langFormat("accessibility.axis."+t+"Description"+(i.length>1?"Plural":"Singular"),{chart:e,names:i.map(function(t){return d(t)}),ranges:i.map(function(t){return u(t)}),numAxes:i.length})}destroy(){this.announcer&&this.announcer.destroy()}}}),i(e,"Accessibility/Components/MenuComponent.js",[e["Core/Chart/Chart.js"],e["Core/Globals.js"],e["Core/Utilities.js"],e["Accessibility/AccessibilityComponent.js"],e["Accessibility/KeyboardNavigationHandler.js"],e["Accessibility/Utils/ChartUtilities.js"],e["Accessibility/Utils/HTMLUtilities.js"]],function(t,e,i,s,n,o,r){let{composed:a}=e,{attr:l,pushUnique:h}=i,{getChartTitle:c,unhideChartElementFromAT:d}=o,{getFakeMouseEvent:u}=r;function p(t){return t.exportSVGElements&&t.exportSVGElements[0]}class g extends s{init(){let t=this.chart,e=this;this.addEvent(t,"exportMenuShown",function(){e.onMenuShown()}),this.addEvent(t,"exportMenuHidden",function(){e.onMenuHidden()}),this.createProxyGroup()}onMenuHidden(){let t=this.chart.exportContextMenu;t&&t.setAttribute("aria-hidden","true"),this.setExportButtonExpandedState("false")}onMenuShown(){let t=this.chart,e=t.exportContextMenu;e&&(this.addAccessibleContextMenuAttribs(),d(t,e)),this.setExportButtonExpandedState("true")}setExportButtonExpandedState(t){this.exportButtonProxy&&this.exportButtonProxy.innerElement.setAttribute("aria-expanded",t)}onChartRender(){let t=this.chart,e=t.focusElement,i=t.accessibility;this.proxyProvider.clearGroup("chartMenu"),this.proxyMenuButton(),this.exportButtonProxy&&e&&e===t.exportingGroup&&(e.focusBorder?t.setFocusToElement(e,this.exportButtonProxy.innerElement):i&&i.keyboardNavigation.tabindexContainer.focus())}proxyMenuButton(){let t=this.chart,e=this.proxyProvider,i=p(t);(function(t){let e=t.options.exporting,i=p(t);return!!(e&&!1!==e.enabled&&e.accessibility&&e.accessibility.enabled&&i&&i.element)})(t)&&i&&(this.exportButtonProxy=e.addProxyElement("chartMenu",{click:i},"button",{"aria-label":t.langFormat("accessibility.exporting.menuButtonLabel",{chart:t,chartTitle:c(t)}),"aria-expanded":!1,title:t.options.lang.contextButtonTitle||null}))}createProxyGroup(){let t=this.chart;t&&this.proxyProvider&&this.proxyProvider.addGroup("chartMenu")}addAccessibleContextMenuAttribs(){let t=this.chart,e=t.exportDivElements;if(e&&e.length){e.forEach(t=>{t&&("LI"!==t.tagName||t.children&&t.children.length?t.setAttribute("aria-hidden","true"):t.setAttribute("tabindex",-1))});let i=e[0]&&e[0].parentNode;i&&l(i,{"aria-hidden":void 0,"aria-label":t.langFormat("accessibility.exporting.chartMenuLabel",{chart:t}),role:"list"})}}getKeyboardNavigation(){let t=this.keyCodes,e=this.chart,i=this;return new n(e,{keyCodeMap:[[[t.left,t.up],function(){return i.onKbdPrevious(this)}],[[t.right,t.down],function(){return i.onKbdNext(this)}],[[t.enter,t.space],function(){return i.onKbdClick(this)}]],validate:function(){return!!e.exporting&&!1!==e.options.exporting.enabled&&!1!==e.options.exporting.accessibility.enabled},init:function(){let t=i.exportButtonProxy,s=i.chart.exportingGroup;t&&s&&e.setFocusToElement(s,t.innerElement)},terminate:function(){e.hideExportMenu()}})}onKbdPrevious(t){let e=this.chart,i=e.options.accessibility,s=t.response,n=e.highlightedExportItemIx||0;for(;n--;)if(e.highlightExportItem(n))return s.success;return i.keyboardNavigation.wrapAround?(e.highlightLastExportItem(),s.success):s.prev}onKbdNext(t){let e=this.chart,i=e.options.accessibility,s=t.response;for(let t=(e.highlightedExportItemIx||0)+1;t<e.exportDivElements.length;++t)if(e.highlightExportItem(t))return s.success;return i.keyboardNavigation.wrapAround?(e.highlightExportItem(0),s.success):s.next}onKbdClick(t){let e=this.chart,i=e.exportDivElements[e.highlightedExportItemIx],s=p(e).element;return e.openMenu?this.fakeClickEvent(i):(this.fakeClickEvent(s),e.highlightExportItem(0)),t.response.success}}return function(e){function i(){let t=p(this);if(t){let e=t.element;e.onclick&&e.onclick(u("click"))}}function s(){let t=this.exportDivElements;t&&this.exportContextMenu&&this.openMenu&&(t.forEach(t=>{t&&"highcharts-menu-item"===t.className&&t.onmouseout&&t.onmouseout(u("mouseout"))}),this.highlightedExportItemIx=0,this.exportContextMenu.hideMenu(),this.container.focus())}function n(t){let e=this.exportDivElements&&this.exportDivElements[t],i=this.exportDivElements&&this.exportDivElements[this.highlightedExportItemIx];if(e&&"LI"===e.tagName&&!(e.children&&e.children.length)){let s=!!(this.renderTo.getElementsByTagName("g")[0]||{}).focus;return e.focus&&s&&e.focus(),i&&i.onmouseout&&i.onmouseout(u("mouseout")),e.onmouseover&&e.onmouseover(u("mouseover")),this.highlightedExportItemIx=t,!0}return!1}function o(){if(this.exportDivElements){let t=this.exportDivElements.length;for(;t--;)if(this.highlightExportItem(t))return!0}return!1}e.compose=function e(r){if(h(a,e)){let e=t.prototype;e.hideExportMenu=s,e.highlightExportItem=n,e.highlightLastExportItem=o,e.showExportMenu=i}}}(g||(g={})),g}),i(e,"Accessibility/KeyboardNavigation.js",[e["Core/Globals.js"],e["Accessibility/Components/MenuComponent.js"],e["Core/Utilities.js"],e["Accessibility/Utils/EventProvider.js"],e["Accessibility/Utils/HTMLUtilities.js"]],function(t,e,i,s,n){let{composed:o,doc:r,win:a}=t,{addEvent:l,fireEvent:h,pushUnique:c}=i,{getElement:d,simulatedEventTarget:u}=n;class p{constructor(t,e){this.currentModuleIx=NaN,this.modules=[],this.init(t,e)}init(t,e){let i=this.eventProvider=new s;this.chart=t,this.components=e,this.modules=[],this.currentModuleIx=0,this.update(),i.addEvent(this.tabindexContainer,"keydown",t=>this.onKeydown(t)),i.addEvent(this.tabindexContainer,"focus",t=>this.onFocus(t)),["mouseup","touchend"].forEach(t=>i.addEvent(r,t,t=>this.onMouseUp(t))),["mousedown","touchstart"].forEach(e=>i.addEvent(t.renderTo,e,()=>{this.isClickingChart=!0}))}update(t){let e=this.chart.options.accessibility,i=e&&e.keyboardNavigation,s=this.components;this.updateContainerTabindex(),i&&i.enabled&&t&&t.length?(this.modules=t.reduce(function(t,e){let i=s[e].getKeyboardNavigation();return t.concat(i)},[]),this.updateExitAnchor()):(this.modules=[],this.currentModuleIx=0,this.removeExitAnchor())}updateExitAnchor(){let t=`highcharts-end-of-chart-marker-${this.chart.index}`,e=d(t);this.removeExitAnchor(),e?(this.makeElementAnExitAnchor(e),this.exitAnchor=e):this.createExitAnchor()}move(t){let e=this.modules&&this.modules[this.currentModuleIx];e&&e.terminate&&e.terminate(t),this.chart.focusElement&&this.chart.focusElement.removeFocusBorder(),this.currentModuleIx+=t;let i=this.modules&&this.modules[this.currentModuleIx];if(i){if(i.validate&&!i.validate())return this.move(t);if(i.init)return i.init(t),!0}return this.currentModuleIx=0,this.exiting=!0,t>0?this.exitAnchor&&this.exitAnchor.focus():this.tabindexContainer.focus(),!1}onFocus(t){let e=this.chart,i=t.relatedTarget&&e.container.contains(t.relatedTarget),s=e.options.accessibility,n=s&&s.keyboardNavigation,o=n&&n.enabled;if(o&&!this.exiting&&!this.tabbingInBackwards&&!this.isClickingChart&&!i){let t=this.getFirstValidModuleIx();null!==t&&(this.currentModuleIx=t,this.modules[t].init(1))}this.keyboardReset=!1,this.exiting=!1}onMouseUp(t){if(delete this.isClickingChart,!this.keyboardReset&&t.relatedTarget!==u){let e=this.chart;if(!t.target||!e.container.contains(t.target)){let t=this.modules&&this.modules[this.currentModuleIx||0];t&&t.terminate&&t.terminate(),this.currentModuleIx=0}e.focusElement&&(e.focusElement.removeFocusBorder(),delete e.focusElement),this.keyboardReset=!0}}onKeydown(t){let e;let i=t||a.event,s=this.modules&&this.modules.length&&this.modules[this.currentModuleIx],n=i.target;if((!n||"INPUT"!==n.nodeName||n.classList.contains("highcharts-a11y-proxy-element"))&&(this.keyboardReset=!1,this.exiting=!1,s)){let t=s.run(i);t===s.response.success?e=!0:t===s.response.prev?e=this.move(-1):t===s.response.next&&(e=this.move(1)),e&&(i.preventDefault(),i.stopPropagation())}}updateContainerTabindex(){let t;let e=this.chart.options.accessibility,i=e&&e.keyboardNavigation,s=!(i&&!1===i.enabled),n=this.chart,o=n.container;n.renderTo.hasAttribute("tabindex")?(o.removeAttribute("tabindex"),t=n.renderTo):t=o,this.tabindexContainer=t;let r=t.getAttribute("tabindex");s&&!r?t.setAttribute("tabindex","0"):s||n.container.removeAttribute("tabindex")}createExitAnchor(){let t=this.chart,e=this.exitAnchor=r.createElement("div");t.renderTo.appendChild(e),this.makeElementAnExitAnchor(e)}makeElementAnExitAnchor(t){let e=this.tabindexContainer.getAttribute("tabindex")||0;t.setAttribute("class","highcharts-exit-anchor"),t.setAttribute("tabindex",e),t.setAttribute("aria-hidden",!1),this.addExitAnchorEventsToEl(t)}removeExitAnchor(){this.exitAnchor&&this.exitAnchor.parentNode&&(this.exitAnchor.parentNode.removeChild(this.exitAnchor),delete this.exitAnchor)}addExitAnchorEventsToEl(t){let e=this.chart,i=this;this.eventProvider.addEvent(t,"focus",function(t){let s=t||a.event,n=s.relatedTarget&&e.container.contains(s.relatedTarget),o=!(n||i.exiting);if(e.focusElement&&delete e.focusElement,o){if(i.tabbingInBackwards=!0,i.tabindexContainer.focus(),delete i.tabbingInBackwards,s.preventDefault(),i.modules&&i.modules.length){i.currentModuleIx=i.modules.length-1;let t=i.modules[i.currentModuleIx];t&&t.validate&&!t.validate()?i.move(-1):t&&t.init(-1)}}else i.exiting=!1})}getFirstValidModuleIx(){let t=this.modules.length;for(let e=0;e<t;++e){let t=this.modules[e];if(!t.validate||t.validate())return e}return null}destroy(){this.removeExitAnchor(),this.eventProvider.removeAddedEvents(),this.chart.container.removeAttribute("tabindex")}}return function(i){function s(){let t=this;h(this,"dismissPopupContent",{},function(){t.tooltip&&t.tooltip.hide(0),t.hideExportMenu()})}function n(e){let i=e.which||e.keyCode;27===i&&t.charts&&t.charts.forEach(t=>{t&&t.dismissPopupContent&&t.dismissPopupContent()})}i.compose=function t(i){if(e.compose(i),c(o,t)){let t=i.prototype;t.dismissPopupContent=s,l(r,"keydown",n)}return i}}(p||(p={})),p}),i(e,"Accessibility/Components/LegendComponent.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Globals.js"],e["Core/Legend/Legend.js"],e["Core/Utilities.js"],e["Accessibility/AccessibilityComponent.js"],e["Accessibility/KeyboardNavigationHandler.js"],e["Accessibility/Utils/ChartUtilities.js"],e["Accessibility/Utils/HTMLUtilities.js"]],function(t,e,i,s,n,o,r,a){let{animObject:l}=t,{composed:h,doc:c}=e,{addEvent:d,fireEvent:u,isNumber:p,pick:g,pushUnique:m,syncTimeout:b}=s,{getChartTitle:f}=r,{stripHTMLTagsFromString:x,addClass:y,removeClass:v}=a;function A(t){let e=t.legend&&t.legend.allItems,i=t.options.legend.accessibility||{},s=t.colorAxis&&t.colorAxis.some(t=>!t.dataClasses||!t.dataClasses.length);return!!(e&&e.length&&!s&&!1!==i.enabled)}function w(t,e){let i=e.legendItem||{};for(let s of(e.setState(t?"hover":"",!0),["group","label","symbol"])){let e=i[s],n=e&&e.element||e;n&&u(n,t?"mouseover":"mouseout")}}class C extends n{constructor(){super(...arguments),this.highlightedLegendItemIx=NaN,this.proxyGroup=null}init(){let t=this;this.recreateProxies(),this.addEvent(i,"afterScroll",function(){this.chart===t.chart&&(t.proxyProvider.updateGroupProxyElementPositions("legend"),t.updateLegendItemProxyVisibility(),t.highlightedLegendItemIx>-1&&this.chart.highlightLegendItem(t.highlightedLegendItemIx))}),this.addEvent(i,"afterPositionItem",function(e){this.chart===t.chart&&this.chart.renderer&&t.updateProxyPositionForItem(e.item)}),this.addEvent(i,"afterRender",function(){this.chart===t.chart&&this.chart.renderer&&t.recreateProxies()&&b(()=>t.proxyProvider.updateGroupProxyElementPositions("legend"),l(g(this.chart.renderer.globalAnimation,!0)).duration)})}updateLegendItemProxyVisibility(){let t;let e=this.chart,i=e.legend,s=i.allItems||[],n=i.currentPage||1,o=i.clipHeight||0;s.forEach(s=>{if(s.a11yProxyElement){let r=i.pages&&i.pages.length,a=s.a11yProxyElement.element,l=!1;if(t=s.legendItem||{},r){let e=t.pageIx||0,s=t.y||0,r=t.label?Math.round(t.label.getBBox().height):0;l=s+r-i.pages[e]>o||e!==n-1}l?e.styledMode?y(a,"highcharts-a11y-invisible"):a.style.visibility="hidden":(v(a,"highcharts-a11y-invisible"),a.style.visibility="")}})}onChartRender(){A(this.chart)||this.removeProxies()}highlightAdjacentLegendPage(t){let e=this.chart,i=e.legend,s=i.currentPage||1,n=s+t,o=i.pages||[];if(n>0&&n<=o.length){let t=0;for(let s of i.allItems)((s.legendItem||{}).pageIx||0)+1===n&&e.highlightLegendItem(t)&&(this.highlightedLegendItemIx=t),++t}}updateProxyPositionForItem(t){t.a11yProxyElement&&t.a11yProxyElement.refreshPosition()}recreateProxies(){let t=c.activeElement,e=this.proxyGroup,i=t&&e&&e.contains(t);return this.removeProxies(),!!A(this.chart)&&(this.addLegendProxyGroup(),this.proxyLegendItems(),this.updateLegendItemProxyVisibility(),this.updateLegendTitle(),i&&this.chart.highlightLegendItem(this.highlightedLegendItemIx),!0)}removeProxies(){this.proxyProvider.removeGroup("legend")}updateLegendTitle(){let t=this.chart,e=x((t.legend&&t.legend.options.title&&t.legend.options.title.text||"").replace(/<br ?\/?>/g," "),t.renderer.forExport),i=t.langFormat("accessibility.legend.legendLabel"+(e?"":"NoTitle"),{chart:t,legendTitle:e,chartTitle:f(t)});this.proxyProvider.updateGroupAttrs("legend",{"aria-label":i})}addLegendProxyGroup(){let t=this.chart.options.accessibility,e="all"===t.landmarkVerbosity?"region":null;this.proxyGroup=this.proxyProvider.addGroup("legend","ul",{"aria-label":"_placeholder_",role:e})}proxyLegendItems(){let t;let e=this,i=(this.chart.legend||{}).allItems||[];i.forEach(i=>{(t=i.legendItem||{}).label&&t.label.element&&e.proxyLegendItem(i)})}proxyLegendItem(t){let e=t.legendItem||{};if(!e.label||!e.group)return;let i=this.chart.langFormat("accessibility.legend.legendItem",{chart:this.chart,itemName:x(t.name,this.chart.renderer.forExport),item:t}),s={tabindex:-1,"aria-pressed":t.visible,"aria-label":i},n=e.group.div?e.label:e.group;t.a11yProxyElement=this.proxyProvider.addProxyElement("legend",{click:e.label,visual:n.element},"button",s)}getKeyboardNavigation(){let t=this.keyCodes,e=this,i=this.chart;return new o(i,{keyCodeMap:[[[t.left,t.right,t.up,t.down],function(t){return e.onKbdArrowKey(this,t)}],[[t.enter,t.space],function(){return e.onKbdClick(this)}],[[t.pageDown,t.pageUp],function(i){let s=i===t.pageDown?1:-1;return e.highlightAdjacentLegendPage(s),this.response.success}]],validate:function(){return e.shouldHaveLegendNavigation()},init:function(){i.highlightLegendItem(0),e.highlightedLegendItemIx=0},terminate:function(){e.highlightedLegendItemIx=-1,i.legend.allItems.forEach(t=>w(!1,t))}})}onKbdArrowKey(t,e){let{keyCodes:{left:i,up:s},highlightedLegendItemIx:n,chart:o}=this,r=o.legend.allItems.length,a=o.options.accessibility.keyboardNavigation.wrapAround,l=e===i||e===s?-1:1,h=o.highlightLegendItem(n+l);return h?this.highlightedLegendItemIx+=l:a&&r>1&&(this.highlightedLegendItemIx=l>0?0:r-1,o.highlightLegendItem(this.highlightedLegendItemIx)),t.response.success}onKbdClick(t){let e=this.chart.legend.allItems[this.highlightedLegendItemIx];return e&&e.a11yProxyElement&&e.a11yProxyElement.click(),t.response.success}shouldHaveLegendNavigation(){if(!A(this.chart))return!1;let t=this.chart,e=t.options.legend||{},i=e.accessibility||{};return!!(t.legend.display&&i.keyboardNavigation&&i.keyboardNavigation.enabled)}destroy(){this.removeProxies()}}return function(t){function e(t){let e=this.legend.allItems,i=this.accessibility&&this.accessibility.components.legend.highlightedLegendItemIx,s=e[t],n=s?.legendItem||{};if(s){p(i)&&e[i]&&w(!1,e[i]),function(t,e){let i=(t.allItems[e].legendItem||{}).pageIx,s=t.currentPage;void 0!==i&&i+1!==s&&t.scroll(1+i-s)}(this.legend,t);let o=n.label,r=s.a11yProxyElement&&s.a11yProxyElement.element;return o&&o.element&&r&&this.setFocusToElement(o,r),w(!0,s),!0}return!1}function i(t){let e=this.chart,i=e.options.accessibility,s=t.item;i.enabled&&s&&s.a11yProxyElement&&s.a11yProxyElement.innerElement.setAttribute("aria-pressed",t.visible?"true":"false")}t.compose=function t(s,n){if(m(h,t)){let t=s.prototype;t.highlightLegendItem=e,d(n,"afterColorizeItem",i)}}}(C||(C={})),C}),i(e,"Core/Axis/NavigatorAxisComposition.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{composed:i,isTouchDevice:s}=t,{addEvent:n,correctFloat:o,defined:r,isNumber:a,pick:l,pushUnique:h}=e;function c(){this.navigatorAxis||(this.navigatorAxis=new u(this))}function d(t){let e=this.chart,i=e.options,n=i.navigator,o=this.navigatorAxis,a=e.zooming.pinchType,l=i.rangeSelector,h=e.zooming.type;if(this.isXAxis&&(n&&n.enabled||l&&l.enabled)){if("y"===h)t.zoomed=!1;else if((!s&&"xy"===h||s&&"xy"===a)&&this.options.range){let e=o.previousZoom;r(t.newMin)?o.previousZoom=[this.min,this.max]:e&&(t.newMin=e[0],t.newMax=e[1],o.previousZoom=void 0)}}void 0!==t.zoomed&&t.preventDefault()}class u{static compose(t){h(i,this.compose)&&(t.keepProps.push("navigatorAxis"),n(t,"init",c),n(t,"zoom",d))}constructor(t){this.axis=t}destroy(){this.axis=void 0}toFixedRange(t,e,i,s){let n=this.axis,h=n.chart,c=l(i,n.translate(t,!0,!n.horiz)),d=l(s,n.translate(e,!0,!n.horiz)),u=h&&h.fixedRange,p=(n.pointRange||0)/2;return r(i)||(c=o(c+p)),r(s)||(d=o(d-p)),u&&n.dataMin&&n.dataMax&&(d>=n.dataMax&&(c=o(n.dataMax-u)),c<=n.dataMin&&(d=o(n.dataMin+u))),a(c)&&a(d)||(c=d=void 0),{min:c,max:d}}}return u}),i(e,"Stock/Navigator/NavigatorDefaults.js",[e["Core/Color/Color.js"],e["Core/Series/SeriesRegistry.js"]],function(t,e){let{parse:i}=t,{seriesTypes:s}=e,n={height:40,margin:25,maskInside:!0,handles:{width:7,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0,lineWidth:1,backgroundColor:"#f2f2f2",borderColor:"#999999"},maskFill:i("#667aff").setOpacity(.3).get(),outlineColor:"#999999",outlineWidth:1,series:{type:void 0===s.areaspline?"line":"areaspline",fillOpacity:.05,lineWidth:1,compare:null,sonification:{enabled:!1},dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,firstAnchor:"firstPoint",anchor:"middle",lastAnchor:"lastPoint",units:[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2,3,4]],["week",[1,2,3]],["month",[1,3,6]],["year",null]]},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},threshold:null},xAxis:{overscroll:0,className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"#e6e6e6",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#000000",fontSize:"0.7em",opacity:.6,textOutline:"2px contrast"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickLength:0,tickWidth:0}};return n}),i(e,"Stock/Navigator/NavigatorSymbols.js",[],function(){return{"navigator-handle":function(t,e,i,s,n={}){let o=n.width?n.width/2:i,r=Math.round(o/3)+.5;return[["M",-o-1,.5],["L",o,.5],["L",o,(s=n.height||s)+.5],["L",-o-1,s+.5],["L",-o-1,.5],["M",-r,4],["L",-r,s-3],["M",r-1,4],["L",r-1,s-3]]}}}),i(e,"Stock/Navigator/NavigatorComposition.js",[e["Core/Defaults.js"],e["Core/Globals.js"],e["Core/Axis/NavigatorAxisComposition.js"],e["Stock/Navigator/NavigatorDefaults.js"],e["Stock/Navigator/NavigatorSymbols.js"],e["Core/Renderer/RendererRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,n,o,r){let a;let{defaultOptions:l,setOptions:h}=t,{composed:c,isTouchDevice:d}=e,{getRendererType:u}=o,{addEvent:p,extend:g,merge:m,pick:b,pushUnique:f}=r;function x(){this.navigator&&this.navigator.setBaseSeries(null,!1)}function y(){let t,e,i;let s=this.legend,n=this.navigator;if(n){t=s&&s.options,e=n.xAxis,i=n.yAxis;let{scrollbarHeight:o,scrollButtonSize:r}=n;this.inverted?(n.left=n.opposite?this.chartWidth-o-n.height:this.spacing[3]+o,n.top=this.plotTop+r):(n.left=b(e.left,this.plotLeft+r),n.top=n.navigatorOptions.top||this.chartHeight-n.height-o-(this.scrollbar?.options.margin||0)-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(t&&"bottom"===t.verticalAlign&&"proximate"!==t.layout&&t.enabled&&!t.floating?s.legendHeight+b(t.margin,10):0)-(this.titleOffset?this.titleOffset[2]:0)),e&&i&&(this.inverted?e.options.left=i.options.left=n.left:e.options.top=i.options.top=n.top,e.setAxisSize(),i.setAxisSize())}}function v(t){!this.navigator&&!this.scroller&&(this.options.navigator.enabled||this.options.scrollbar.enabled)&&(this.scroller=this.navigator=new a(this),b(t.redraw,!0)&&this.redraw(t.animation))}function A(){let t=this.options;(t.navigator.enabled||t.scrollbar.enabled)&&(this.scroller=this.navigator=new a(this))}function w(){let t=this.options,e=t.navigator,i=t.rangeSelector;if((e&&e.enabled||i&&i.enabled)&&(!d&&"x"===this.zooming.type||d&&"x"===this.zooming.pinchType))return!1}function C(t){let e=t.navigator;if(e&&t.xAxis[0]){let i=t.xAxis[0].getExtremes();e.render(i.min,i.max)}}function E(t){let e=t.options.navigator||{},i=t.options.scrollbar||{};!this.navigator&&!this.scroller&&(e.enabled||i.enabled)&&(m(!0,this.options.navigator,e),m(!0,this.options.scrollbar,i),delete t.options.navigator,delete t.options.scrollbar)}function T(){this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)}return{compose:function t(e,o,r,h){if(i.compose(e),a=r,f(c,t)){let t=o.prototype;t.callbacks.push(C),p(o,"afterAddSeries",x),p(o,"afterSetChartSize",y),p(o,"afterUpdate",v),p(o,"beforeRender",A),p(o,"beforeShowResetZoom",w),p(o,"update",E),p(h,"afterUpdate",T),g(u().prototype.symbols,n),g(l,{navigator:s})}}}}),i(e,"Core/Axis/ScrollbarAxis.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){var i;let{composed:s}=t,{addEvent:n,defined:o,pick:r,pushUnique:a}=e;return function(t){let e;function i(t){let e=r(t.options&&t.options.min,t.min),i=r(t.options&&t.options.max,t.max);return{axisMin:e,axisMax:i,scrollMin:o(t.dataMin)?Math.min(e,t.min,t.dataMin,r(t.threshold,1/0)):e,scrollMax:o(t.dataMax)?Math.max(i,t.max,t.dataMax,r(t.threshold,-1/0)):i}}function l(){let t=this.scrollbar,e=t&&!t.options.opposite,i=this.horiz?2:e?3:1;t&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[i]+=t.size+(t.options.margin||0))}function h(){let t=this;t.options&&t.options.scrollbar&&t.options.scrollbar.enabled&&(t.options.scrollbar.vertical=!t.horiz,t.options.startOnTick=t.options.endOnTick=!1,t.scrollbar=new e(t.chart.renderer,t.options.scrollbar,t.chart),n(t.scrollbar,"changed",function(e){let s,n;let{axisMin:r,axisMax:a,scrollMin:l,scrollMax:h}=i(t),c=h-l;if(o(r)&&o(a)){if(t.horiz&&!t.reversed||!t.horiz&&t.reversed?(s=l+c*this.to,n=l+c*this.from):(s=l+c*(1-this.from),n=l+c*(1-this.to)),this.shouldUpdateExtremes(e.DOMType)){let i="mousemove"!==e.DOMType&&"touchmove"!==e.DOMType&&void 0;t.setExtremes(n,s,!0,i,e)}else this.setRange(this.from,this.to)}}))}function c(){let t,e,s;let{scrollMin:n,scrollMax:r}=i(this),a=this.scrollbar,l=this.axisTitleMargin+(this.titleOffset||0),h=this.chart.scrollbarsOffsets,c=this.options.margin||0;if(a&&h){if(this.horiz)this.opposite||(h[1]+=l),a.position(this.left,this.top+this.height+2+h[1]-(this.opposite?c:0),this.width,this.height),this.opposite||(h[1]+=c),t=1;else{let e;this.opposite&&(h[0]+=l),e=a.options.opposite?this.left+this.width+2+h[0]-(this.opposite?0:c):this.opposite?0:c,a.position(e,this.top,this.width,this.height),this.opposite&&(h[0]+=c),t=0}h[t]+=