PageSourceSearch

https://www.groverclevelandhs.org/apps/webapps/common/accessible-menu/4.2.2/accessible-menu.esc5-pack.js

js groverclevelandhs.org collected 2026-09-30 11:36:57 UTC 65,026 bytes, 2 lines download raw bytes

1function _superPropGet(e,t,n,r){var o=_get(_getPrototypeOf(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function _get(){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=_superPropBase(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(null,arguments)}function _superPropBase(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _callSuper(e,t,n){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],_getPrototypeOf(e).constructor):t.apply(e,n))}function _possibleConstructorReturn(e,t){if(t&&("object"==_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var AccessibleMenu=function(){"use strict";var e=Object.defineProperty,t=function(t,n,r){return function(t,n,r){return n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r}(t,"symbol"!=_typeof(n)?n+"":n,r)};function n(e,t){var n;""===e||0===e.length||("string"==typeof e?t.classList.add(e):(n=t.classList).add.apply(n,_toConsumableArray(e)))}function r(e,t){var n;""===e||0===e.length||("string"==typeof e?t.classList.remove(e):(n=t.classList).remove.apply(n,_toConsumableArray(e)))}function o(e,t){try{if("object"!=_typeof(t)){var n=_typeof(t);throw new TypeError('Elements given to isValidInstance() must be inside of an object. "'.concat(n,'" given.'))}for(var r in t)if(!(t[r]instanceof e)){var o=_typeof(t[r]);throw new TypeError("".concat(r," must be an instance of ").concat(e.name,'. "').concat(o,'" given.'))}return{status:!0,error:null}}catch(n){return{status:!1,error:n}}}function s(e,t){try{if("object"!=_typeof(t)){var n=_typeof(t);throw new TypeError('Values given to isValidType() must be inside of an object. "'.concat(n,'" given.'))}for(var r in t){var o=_typeof(t[r]);if(o!==e)throw new TypeError("".concat(r," must be a ").concat(e,'. "').concat(o,'" given.'))}return{status:!0,error:null}}catch(n){return{status:!1,error:n}}}function i(e){try{if("object"!=_typeof(e)){var t=_typeof(e);throw new TypeError('Values given to isQuerySelector() must be inside of an object. "'.concat(t,'" given.'))}for(var n in e)try{if(null===e[n])throw new Error;document.querySelector(e[n])}catch(t){throw new TypeError("".concat(n,' must be a valid query selector. "').concat(e[n],'" given.'))}return{status:!0,error:null}}catch(t){return{status:!1,error:t}}}function u(e){try{if("object"!=_typeof(e)||Array.isArray(e)){var t=_typeof(e);throw new TypeError('Values given to isValidClassList() must be inside of an object. "'.concat(t,'" given.'))}var n=function(t){var n=_typeof(e[t]);if("string"!==n){if(!Array.isArray(e[t]))throw new TypeError("".concat(t,' must be a string or an array of str
1ings. "').concat(n,'" given.'));e[t].forEach(function(e){if("string"!=typeof e)throw new TypeError("".concat(t," must be a string or an array of strings. An array containing non-strings given."))})}else{var r={};r[t]=e[t],i(r)}};for(var r in e)n(r);return{status:!0,error:null}}catch(t){return{status:!1,error:t}}}function l(e){try{if("object"!=_typeof(e)){var t=_typeof(e);throw new TypeError('Values given to isValidHoverType() must be inside of an object. "'.concat(t,'" given.'))}var n=["off","on","dynamic"];for(var r in e)if(!n.includes(e[r]))throw new TypeError("".concat(r," must be one of the following values: ").concat(n.join(", "),'. "').concat(e[r],'" given.'));return{status:!0,error:null}}catch(n){return{status:!1,error:n}}}function a(e,t){if(s("string",{tagName:e}).status&&o(HTMLElement,t).status){var n=e.toLowerCase(),r=!0;for(var i in t)t[i].tagName.toLowerCase()!==n&&(r=!1);return r}return!1}var c=function(){return _createClass(function e(n){var r=n.menuToggleElement,o=n.parentElement,s=n.controlledMenu,i=n.parentMenu,u=void 0===i?null:i;_classCallCheck(this,e),t(this,"_dom",{toggle:null,parent:null}),t(this,"_elements",{controlledMenu:null,parentMenu:null}),t(this,"_open",!1),t(this,"_expandEvent",new CustomEvent("accessibleMenuExpand",{bubbles:!0,detail:{toggle:this}})),t(this,"_collapseEvent",new CustomEvent("accessibleMenuCollapse",{bubbles:!0,detail:{toggle:this}})),this._dom.toggle=r,this._dom.parent=o,this._elements.controlledMenu=s,this._elements.parentMenu=u},[{key:"initialize",value:function(){this._setIds(),this._setAriaAttributes(),this._collapse(!1)}},{key:"dom",get:function(){return this._dom}},{key:"elements",get:function(){return this._elements}},{key:"isOpen",get:function(){return this._open},set:function(e){s("boolean",{value:e}),this._open=e}},{key:"_setIds",value:function(){var e;if(""===this.dom.toggle.id||""===this.elements.controlledMenu.dom.menu.id){var t=Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,10),n=(null==(e=this.dom.toggle.innerText)?void 0:e.replace(/[^a-zA-Z0-9\s]/g,""))||"",r=t;!n.replace(/\s/g,"").length&&this.dom.toggle.getAttribute("aria-label")&&(n=this.dom.toggle.getAttribute("aria-label").replace(/[^a-zA-Z0-9\s]/g,"")),n.replace(/\s/g,"").length>0&&((n=n.toLowerCase().replace(/\s+/g,"-")).startsWith("-")&&(n=n.substring(1)),n.endsWith("-")&&(n=n.slice(0,-1)),r="".concat(n,"-").concat(r)),this.dom.toggle.id=this.dom.toggle.id||"menu-button-".concat(r),this.elements.controlledMenu.dom.menu.id=this.elements.controlledMenu.dom.menu.id||"menu-".concat(r)}}},{key:"_setAriaAttributes",value:function(){this.dom.toggle.setAttribute("aria-expanded","false"),this.elements.controlledMenu.dom.menu.setAttribute("aria-labelledby",this.dom.toggle.id)}},{key:"_expand",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=this.elements.controlledMenu,s=o.closeClass,i=o.openClass,u=o.transitionClass,l=o.openDuration;this.dom.toggle.setAttribute("aria-expanded","true"),this.elements.controlledMenu.elements.rootMenu.hasOpened=!0,""!==u?(n(u,this.elements.controlledMenu.dom.menu),requestAnimationFrame(function(){r(s,e.elements.controlledMenu.dom.menu),requestAnimationFrame(function(){n(i,e.elements.controlledMenu.dom.menu),requestAnimationFrame(function(){setTimeout(function(){r(u,e.elements.controlledMenu.dom.menu)},l)})})})):(n(i,this.elements.controlledMenu.dom.menu),r(s,this.elements.controlledMenu.dom.menu)),t&&this.dom.toggle.dispatchEvent(this._expandEvent)}},{key:"_collapse",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=this.elements.controlledMenu,s=o.closeClass,i=o.openClass,u=o.transitionClass,l=o.closeDuration;this.dom.toggle.setAttribute("aria-expanded","false"),""!==u?(n(u,this.elements.controlledMenu.dom.menu),requestAnimationFrame(function(){r(i,e.elements.controlledMenu.dom.menu),requestAnimationFrame(function(){n(s,e.elements.controlledMenu.dom.menu),requestAnimationFrame(function(){setTimeout(function(){r(u,e.elements.controlledMenu.dom.menu)},l)})})})):(n(s,this.elements.controlledMenu.dom.menu),r(i,this.elements.controlledMenu.dom.menu)),t&&this.dom.toggle.dispatchEvent(this._collapseEvent)}}
1,{key:"open",value:function(){this.elements.controlledMenu.focusState="self",this.isOpen||(this._expand(),this.isOpen=!0)}},{key:"preview",value:function(){this.elements.parentMenu&&(this.elements.parentMenu.focusState="self"),this.isOpen||(this._expand(),this.isOpen=!0)}},{key:"close",value:function(){this.isOpen&&(this.elements.controlledMenu.blur(),this.elements.parentMenu&&(this.elements.parentMenu.focusState="self"),this._collapse(),this.isOpen=!1)}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"closeSiblings",value:function(){var e=this;this.elements.parentMenu&&this.elements.parentMenu.elements.submenuToggles.forEach(function(t){t!==e&&t.close()})}},{key:"closeChildren",value:function(){this.elements.controlledMenu.elements.submenuToggles.forEach(function(e){return e.close()})}}])}(),m=function(){return _createClass(function e(n){var r=n.menuItemElement,o=n.menuLinkElement,s=n.parentMenu,i=n.isSubmenuItem,u=void 0!==i&&i,l=n.childMenu,a=void 0===l?null:l,c=n.toggle,m=void 0===c?null:c;_classCallCheck(this,e),t(this,"_dom",{item:null,link:null}),t(this,"_elements",{parentMenu:null,childMenu:null,toggle:null}),t(this,"_submenu",!1),this._dom.item=r,this._dom.link=o,this._elements.parentMenu=s,this._elements.childMenu=a,this._elements.toggle=m,this._submenu=u},[{key:"initialize",value:function(){}},{key:"dom",get:function(){return this._dom}},{key:"elements",get:function(){return this._elements}},{key:"isSubmenuItem",get:function(){return this._submenu}},{key:"focus",value:function(){var e=this;this.elements.parentMenu.shouldFocus&&requestAnimationFrame(function(){e.dom.link.focus()})}},{key:"blur",value:function(){var e=this;this.elements.parentMenu.shouldFocus&&requestAnimationFrame(function(){e.dom.link.blur()})}}])}();function h(e){try{var t=e.key||e.keyCode,n={Enter:"Enter"===t||13===t,Space:" "===t||"Spacebar"===t||32===t,Escape:"Escape"===t||"Esc"===t||27===t,ArrowUp:"ArrowUp"===t||"Up"===t||38===t,ArrowRight:"ArrowRight"===t||"Right"===t||39===t,ArrowDown:"ArrowDown"===t||"Down"===t||40===t,ArrowLeft:"ArrowLeft"===t||"Left"===t||37===t,Home:"Home"===t||36===t,End:"End"===t||35===t,Character:isNaN(t)&&!!t.match(/^[a-zA-Z]{1}$/),Tab:"Tab"===t||9===t,Asterisk:"*"===t||56===t};return Object.keys(n).find(function(e){return!0===n[e]})||""}catch(e){return""}}function d(e){e.preventDefault(),e.stopPropagation()}var p=function(){function e(n){var r=n.menuElement,o=n.menuItemSelector,s=void 0===o?"li":o,i=n.menuLinkSelector,u=void 0===i?"a":i,l=n.submenuItemSelector,a=void 0===l?"li:has(ul)":l,h=n.submenuToggleSelector,d=void 0===h?"a":h,p=n.submenuSelector,v=void 0===p?"ul":p,f=n.controllerElement,y=void 0===f?null:f,g=n.containerElement,_=void 0===g?null:g,b=n.openClass,M=void 0===b?"show":b,C=n.closeClass,E=void 0===C?"hide":C,T=n.transitionClass,I=void 0===T?"transitioning":T,k=n.transitionDuration,S=void 0===k?250:k,w=n.openDuration,D=void 0===w?-1:w,L=n.closeDuration,A=void 0===L?-1:L,O=n.isTopLevel,P=void 0===O||O,x=n.parentMenu,K=void 0===x?null:x,z=n.hoverType,F=void 0===z?"off":z,j=n.hoverDelay,G=void 0===j?250:j,N=n.enterDelay,R=void 0===N?-1:N,H=n.leaveDelay,q=void 0===H?-1:H,U=n.prefix,V=void 0===U?"am-":U;_classCallCheck(this,e),t(this,"_MenuType",e),t(this,"_MenuItemType",m),t(this,"_MenuToggleType",c),t(this,"_dom",{menu:null,menuItems:[],submenuItems:[],submenuToggles:[],submenus:[],controller:null,container:null}),t(this,"_selectors",{menuItems:"",menuLinks:"",submenuItems:"",submenuToggles:"",submenus:""}),t(this,"_elements",{menuItems:[],submenuToggles:[],controller:null,parentMenu:null,rootMenu:null}),t(this,"_openClass","show"),t(this,"_closeClass","hide"),t(this,"_transitionClass","transitioning"),t(this,"_transitionDuration",250),t(this,"_openDuration",-1),t(this,"_closeDuration",-1),t(this,"_root",!0),t(this,"_currentChild",0),t(this,"_focusState","none"),t(this,"_currentEvent","none"),t(this,"_hoverType","off"),t(this,"_hoverDelay",250),t(this,"_enterDelay",-1),t(this,"_leaveDelay",-1),t(this,"_prefix","am-"),t(this,"_hoverTimeout",null),t(this,"_hasOpened",!1),t(this,"_errors",[]),this._dom.menu=r,this._dom.controller=y,this._dom.container=_,this._selectors.menuItems=s,this._selectors.menuLinks=u,this._selectors.submenuItems=a,this._selectors.submenuToggles=d,this._selectors.submenus=v,this._elements.menuItems=[],this._elements.submenuToggles=[],this._elements.controller=null,this._elements.parentMenu=K,this._elements.rootMenu=P?this:null,this._openClass=M||"",this._closeClass=E||"",this._transitionClass=I||"",this._transitionDuration=S,this._openDuration=D,this._closeDuration=A,this._prefix=V||"",this._root=P,this._hoverType=F,this._hoverDelay=G,this._enterDelay=R,this._leaveDelay=q}return _createClass(e,[{key:"initialize",value:function(){if(!this._val
1idate())throw new Error("AccessibleMenu: cannot initialize menu. The following errors have been found:\n - ".concat(this.errors.join("\n - ")));if(null===this.elements.rootMenu&&this._findRootMenu(this),this._setDOMElements(),this.isTopLevel&&this.dom.controller&&this.dom.container){var e=new this._MenuToggleType({menuToggleElement:this.dom.controller,parentElement:this.dom.container,controlledMenu:this});a("button",{toggle:e.dom.toggle})||e.dom.toggle.setAttribute("role","button"),e.dom.toggle.setAttribute("aria-controls",this.dom.menu.id),this._elements.controller=e}this._createChildElements(),this._setTransitionDurations(),this.isTopLevel&&(window.AccessibleMenu=window.AccessibleMenu||{menus:{}},window.AccessibleMenu.menus[this.dom.menu.id]=this)}},{key:"dom",get:function(){return this._dom}},{key:"selectors",get:function(){return this._selectors}},{key:"elements",get:function(){return this._elements}},{key:"isTopLevel",get:function(){return this._root}},{key:"openClass",get:function(){return this.isTopLevel?this._openClass:this.elements.rootMenu.openClass},set:function(e){u({openClass:e}),this._openClass!==e&&(this._openClass=e)}},{key:"closeClass",get:function(){return this.isTopLevel?this._closeClass:this.elements.rootMenu.closeClass},set:function(e){u({closeClass:e}),this._closeClass!==e&&(this._closeClass=e)}},{key:"transitionClass",get:function(){return this.isTopLevel?this._transitionClass:this.elements.rootMenu.transitionClass},set:function(e){u({transitionClass:e}),this._transitionClass!==e&&(this._transitionClass=e)}},{key:"transitionDuration",get:function(){return this.isTopLevel?this._transitionDuration:this.elements.rootMenu.transitionDuration},set:function(e){s("number",{value:e}),this._transitionDuration!==e&&(this._transitionDuration=e,this._setTransitionDurations())}},{key:"openDuration",get:function(){return-1===this._openDuration?this.transitionDuration:this.isTopLevel?this._openDuration:this.elements.rootMenu.openDuration},set:function(e){s("number",{value:e}),this._openDuration!==e&&(this._openDuration=e,this._setTransitionDurations())}},{key:"closeDuration",get:function(){return-1===this._closeDuration?this.transitionDuration:this.isTopLevel?this._closeDuration:this.elements.rootMenu.closeDuration},set:function(e){s("number",{value:e}),this._closeDuration!==e&&(this._closeDuration=e,this._setTransitionDurations())}},{key:"currentChild",get:function(){return this._currentChild},set:function(e){function t(e){if(["mouse","character"].includes(e.currentEvent)&&e.elements.parentMenu)for(var t=0,n=!1;!n&&t<e.elements.parentMenu.elements.menuItems.length;){var r=e.elements.parentMenu.elements.menuItems[t];r.isSubmenuItem&&r.elements.toggle.elements.controlledMenu===e&&(n=!0,e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.currentChild=t),t++}}s("number",{value:e}),e<-1?(this._currentChild=-1,t(this)):e>=this.elements.menuItems.length?(this._currentChild=this.elements.menuItems.length-1,t(this)):this.focusChild!==e&&(this._currentChild=e,t(this))}},{key:"focusState",get:function(){return this._focusState},set:function(e){(function(e){try{if("object"!=_typeof(e)){var t=_typeof(e);throw new TypeError('Values given to isValidState() must be inside of an object. "'.concat(t,'" given.'))}var n=["none","self","child"];for(var r in e)if(!n.includes(e[r]))throw new TypeError("".concat(r," must be one of the following values: ").concat(n.join(", "),'. "').concat(e[r],'" given.'))}catch(n){return{status:!1,error:n}}})({value:e}),this._focusState!==e&&(this._focusState=e),this.elements.submenuToggles.length>0&&("self"===e||"none"===e)&&this.elements.submenuToggles.forEach(function(e){e.elements.controlledMenu.focusState="none"}),this.elements.parentMenu&&("self"===e||"child"===e)&&(this.elements.parentMenu.focusState="child")}},{key:"currentEvent",get:function(){return this._currentEvent},set:function(e){(function(e){try{if("object"!=_typeof(e)){var t=_typeof(e);throw new TypeError('Values given to isValidEvent() must be inside of an object. "'.concat(t,'" given.'))}var n=["none","mouse","keyboard","character"];for(var r in e)if(!n.includes(e[r]))throw new TypeError("".concat(r," must be one of the following values: ").concat(n.join(", "),'. "').concat(e[r],'" given.'))}catch(n){return{status:!1,error:n}}})({value:e}),this._currentEvent!==e&&(this._currentEvent=e,this.elements.submenuToggles.length>
10&&this.elements.submenuToggles.forEach(function(t){t.elements.controlledMenu.currentEvent=e}))}},{key:"currentMenuItem",get:function(){return this.elements.menuItems[this.currentChild]}},{key:"hoverType",get:function(){return this._root?this._hoverType:this.elements.rootMenu.hoverType},set:function(e){l({value:e}),this._hoverType!==e&&(this._hoverType=e)}},{key:"hoverDelay",get:function(){return this._root?this._hoverDelay:this.elements.rootMenu.hoverDelay},set:function(e){s("number",{value:e}),this._hoverDelay!==e&&(this._hoverDelay=e)}},{key:"enterDelay",get:function(){return-1===this._enterDelay?this.hoverDelay:this._root?this._enterDelay:this.elements.rootMenu.enterDelay},set:function(e){s("number",{value:e}),this._enterDelay!==e&&(this._enterDelay=e)}},{key:"leaveDelay",get:function(){return-1===this._leaveDelay?this.hoverDelay:this._root?this._leaveDelay:this.elements.rootMenu.leaveDelay},set:function(e){s("number",{value:e}),this._leaveDelay!==e&&(this._leaveDelay=e)}},{key:"prefix",get:function(){return this._root?this._prefix:this.elements.rootMenu.prefix},set:function(e){s("string",{value:e}),this._prefix!==e&&(this._prefix=e)}},{key:"shouldFocus",get:function(){var e=!1;return("keyboard"===this.currentEvent||"character"===this.currentEvent)&&(e=!0),"mouse"===this.currentEvent&&"dynamic"===this.hoverType&&(e=!0),e}},{key:"hasOpened",get:function(){return this._root?this._hasOpened:this.elements.rootMenu.hasOpened},set:function(e){s("boolean",{value:e}),this._hasOpened!==e&&(this._hasOpened=e)}},{key:"errors",get:function(){return this._errors}},{key:"_validate",value:function(){var t,n,r=!0;if((t=null!==this._dom.container||null!==this._dom.controller?o(HTMLElement,{menuElement:this._dom.menu,controllerElement:this._dom.controller,containerElement:this._dom.container}):o(HTMLElement,{menuElement:this._dom.menu})).status||(this._errors.push(t.error.message),r=!1),(n=""!==this._selectors.submenuItems?i({menuItemSelector:this._selectors.menuItems,menuLinkSelector:this._selectors.menuLinks,submenuItemSelector:this._selectors.submenuItems,submenuToggleSelector:this._selectors.submenuToggles,submenuSelector:this._selectors.submenus}):i({menuItemSelector:this._selectors.menuItems,menuLinkSelector:this._selectors.menuLinks})).status||(this._errors.push(n.error.message),r=!1),""!==this._openClass){var a=u({openClass:this._openClass});a.status||(this._errors.push(a.error.message),r=!1)}if(""!==this._closeClass){var c=u({closeClass:this._closeClass});c.status||(this._errors.push(c.error.message),r=!1)}if(""!==this._transitionClass){var m=u({transitionClass:this._transitionClass});m.status||(this._errors.push(m.error.message),r=!1)}var h=s("number",{transitionDuration:this._transitionDuration});h.status||(this._errors.push(h.error.message),r=!1);var d=s("number",{openDuration:this._openDuration});d.status||(this._errors.push(d.error.message),r=!1);var p=s("number",{closeDuration:this._closeDuration});p.status||(this._errors.push(p.error.message),r=!1);var v=s("boolean",{isTopLevel:this._root});if(v.status||(this._errors.push(v.error.message),r=!1),null!==this._elements.parentMenu){var f=o(e,{parentMenu:this._elements.parentMenu});f.status||(this._errors.push(f.error.message),r=!1)}var y=l({hoverType:this._hoverType});y.status||(this._errors.push(y.error.message),r=!1);var g=s("number",{hoverDelay:this._hoverDelay});g.status||(this._errors.push(g.error.message),r=!1);var _=s("number",{enterDelay:this._enterDelay});_.status||(this._errors.push(_.error.message),r=!1);var b=s("number",{leaveDelay:this._leaveDelay});b.status||(this._errors.push(b.error.message),r=!1);var M=s("string",{prefix:this._prefix});return M.status||(this._errors.push(M.error.message),r=!1),r}},{key:"_setDOMElementType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dom.menu,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("string"!=typeof this.selectors[e])throw new Error('AccessibleMenu: "'.concat(e,'" is not a valid element type within the menu.'));if(!Array.isArray(this.dom[e]))throw new Error('AccessibleMenu: The "'.concat(e,'" element cannot be set through _setDOMElementType.'));t!==this.dom.menu&&o(HTMLElement,{base:t});var r=Array.from(t.querySelectorAll(this.selectors[e])).filter(function(e){return e.parentElement===t});this._dom[e]=n?r:[].concat(_toConsumableArray(this._dom[e]),_toConsumableArray(r))}},{key:"_resetDOMElementType",value:function(e){if(!(_typeof(this.dom[e])<"u"))throw new Error('AccessibleMenu: "'.concat(e,'" is not a valid element type within the menu.'));if(!Array.isArray(this.dom[e]))throw new Error('AccessibleMenu: The "'.concat(e,'" element cannot be reset through _resetDOMElementType.'));this._dom[e]=[]}},{key:"_setDOMElements",value:function(){var e=this;this._setDOMElementType("menuItems"),""!==this.selectors.submenuItems&&(this._setDOMElementType("submenuItems"),this._resetDOMElementType("submenuToggles"),this._resetDOMElementType("submenus"),this.dom.submenuItems.forEac
1h(function(t){e._setDOMElementType("submenuToggles",t,!1),e._setDOMElementType("submenus",t,!1)}))}},{key:"_findRootMenu",value:function(e){if(e.isTopLevel)this._elements.rootMenu=e;else{if(null===e.elements.parentMenu)throw new Error("Cannot find root menu.");this._findRootMenu(e.elements.parentMenu)}}},{key:"_createChildElements",value:function(){var e=this;this.dom.menuItems.forEach(function(t){var n;if(e.dom.submenuItems.includes(t)){var r=t.querySelector(e.selectors.submenuToggles),o=t.querySelector(e.selectors.submenus),s=new e._MenuType({menuElement:o,menuItemSelector:e.selectors.menuItems,menuLinkSelector:e.selectors.menuLinks,submenuItemSelector:e.selectors.submenuItems,submenuToggleSelector:e.selectors.submenuToggles,submenuSelector:e.selectors.submenus,openClass:e.openClass,closeClass:e.closeClass,transitionClass:e.transitionClass,transitionDuration:e.transitionDuration,openDuration:e.openDuration,closeDuration:e.closeDuration,isTopLevel:!1,parentMenu:e,hoverType:e.hoverType,hoverDelay:e.hoverDelay,enterDelay:e.enterDelay,leaveDelay:e.leaveDelay}),i=new e._MenuToggleType({menuToggleElement:r,parentElement:t,controlledMenu:s,parentMenu:e});e._elements.submenuToggles.push(i),n=new e._MenuItemType({menuItemElement:t,menuLinkElement:r,parentMenu:e,isSubmenuItem:!0,childMenu:s,toggle:i})}else{var u=t.querySelector(e.selectors.menuLinks);n=new e._MenuItemType({menuItemElement:t,menuLinkElement:u,parentMenu:e})}e._elements.menuItems.push(n)})}},{key:"_clearTimeout",value:function(){clearTimeout(this._hoverTimeout)}},{key:"_setTimeout",value:function(e,t){s("function",{callback:e}),s("number",{delay:t}),this._hoverTimeout=setTimeout(e,t)}},{key:"_handleFocus",value:function(){var e=this;this.elements.menuItems.forEach(function(t,n){t.dom.link.addEventListener("focus",function(){e.focusState="self",e.currentChild=n})}),this.dom.menu.addEventListener("focusout",function(t){"keyboard"!==e.currentEvent||null===t.relatedTarget||e.dom.menu.contains(t.relatedTarget)||(e.focusState="none",e.closeChildren())})}},{key:"_handleClick",value:function(){var e=this;function t(e,t,n){d(n),0===n.button&&(t.toggle(),t.isOpen&&(e.focusState="self",t.elements.controlledMenu.focusState="none"))}this.elements.menuItems.forEach(function(n,r){n.dom.link.addEventListener("pointerdown",function(){e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e._clearTimeout(),e.focusChild(r)},{passive:!0}),n.isSubmenuItem&&n.elements.toggle.dom.toggle.addEventListener("pointerup",function(r){e.currentEvent="mouse",t(e,n.elements.toggle,r)})}),this.isTopLevel&&this.elements.controller&&this.elements.controller.dom.toggle.addEventListener("pointerup",function(n){e.currentEvent="mouse",t(e,e.elements.controller,n)}),document.addEventListener("pointerup",function(t){"none"!==e.focusState&&(e.currentEvent="mouse",!e.dom.menu.contains(t.target)&&!e.dom.menu!==t.target&&(e.elements.rootMenu.hasOpened=e.elements.submenuToggles.some(function(e){return e.isOpen})))})}},{key:"_handleHover",value:function(){var e=this;this.elements.menuItems.forEach(function(t,n){t.dom.link.addEventListener("pointerenter",function(r){"pen"===r.pointerType||"touch"===r.pointerType||("on"===e.hoverType?(e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusChild(n),t.isSubmenuItem&&(e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){t.elements.toggle.preview()},e.enterDelay)):t.elements.toggle.preview())):"dynamic"===e.hoverType&&(e.currentChild=n,(!e.isTopLevel||"none"!==e.focusState)&&(e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusCurrentChild()),(!e.isTopLevel||e.hasOpened)&&(e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusCurrentChild(),t.isSubmenuItem?e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){t.elements.toggle.preview()},e.enterDelay)):t.elements.toggle.preview():e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.closeChildren()},e.enterDelay)):e.closeChildren())))}),t.isSubmenuItem&&(t.dom.item.addEventListener("pointerleave",function(n){"pen"===n.pointerType||"touch"===n.pointerType||("on"===e.hoverType?e.leaveDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.currentEvent="mou
1se",t.elements.toggle.close()},e.leaveDelay)):(e.currentEvent="mouse",t.elements.toggle.close()):"dynamic"===e.hoverType&&(e.leaveDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.currentEvent="mouse"},e.leaveDelay)):e.currentEvent="mouse"))}),t.dom.item.addEventListener("pointerenter",function(n){"pen"===n.pointerType||"touch"===n.pointerType||t.isSubmenuItem&&("on"===e.hoverType||"dynamic"===e.hoverType)&&e.leaveDelay>0&&e._clearTimeout()}))})}},{key:"_handleKeydown",value:function(){var e=this;this.isTopLevel&&this.elements.controller&&this.elements.controller.dom.toggle.addEventListener("keydown",function(t){e.currentEvent="keyboard";var n=h(t);("Space"===n||"Enter"===n)&&d(t)})}},{key:"_handleKeyup",value:function(){var e=this;this.isTopLevel&&this.elements.controller&&this.elements.controller.dom.toggle.addEventListener("keyup",function(t){e.currentEvent="keyboard";var n=h(t);("Space"===n||"Enter"===n)&&(d(t),e.elements.controller.toggle(),e.elements.controller.isOpen&&e.focusFirstChild())})}},{key:"_setTransitionDurations",value:function(){this.dom.menu.style.setProperty("--".concat(this.prefix,"transition-duration"),"".concat(this.transitionDuration,"ms")),this.dom.menu.style.setProperty("--".concat(this.prefix,"open-transition-duration"),"".concat(this.openDuration,"ms")),this.dom.menu.style.setProperty("--".concat(this.prefix,"close-transition-duration"),"".concat(this.closeDuration,"ms"))}},{key:"focus",value:function(){this.focusState="self",this.shouldFocus&&this.dom.menu.focus()}},{key:"blur",value:function(){this.focusState="none",this.shouldFocus&&this.dom.menu.blur()}},{key:"focusCurrentChild",value:function(){this.focusState="self",-1!==this.currentChild&&this.currentMenuItem.focus()}},{key:"focusChild",value:function(e){this.blurCurrentChild(),this.currentChild=e,this.focusCurrentChild()}},{key:"focusFirstChild",value:function(){this.focusChild(0)}},{key:"focusLastChild",value:function(){this.focusChild(this.elements.menuItems.length-1)}},{key:"focusNextChild",value:function(){this.currentChild<this.elements.menuItems.length-1?this.focusChild(this.currentChild+1):this.focusCurrentChild()}},{key:"focusPreviousChild",value:function(){this.currentChild>0?this.focusChild(this.currentChild-1):this.focusCurrentChild()}},{key:"blurCurrentChild",value:function(){this.focusState="none",-1!==this.currentChild&&this.currentMenuItem.blur()}},{key:"focusController",value:function(){this.dom.controller&&(this.shouldFocus&&this.dom.controller.focus(),this.focusState="none")}},{key:"focusContainer",value:function(){this.dom.container&&(this.shouldFocus&&this.dom.container.focus(),this.focusState="none")}},{key:"closeChildren",value:function(){this.elements.submenuToggles.forEach(function(e){return e.close()})}},{key:"blurChildren",value:function(){this.elements.menuItems.forEach(function(e){e.blur(),e.isSubmenuItem&&e.elements.childMenu.blurChildren()})}}])}(),v=function(e){function t(e){var n,r=e.menuItemElement,o=e.menuLinkElement,s=e.parentMenu,i=e.isSubmenuItem,u=void 0!==i&&i,l=e.childMenu,a=void 0===l?null:l,c=e.toggle,m=void 0===c?null:c,h=e.initialize,d=void 0===h||h;return _classCallCheck(this,t),n=_callSuper(this,t,[{menuItemElement:r,menuLinkElement:o,parentMenu:s,isSubmenuItem:u,childMenu:a,toggle:m}]),d&&n.initialize(),n}return _inherits(t,m),_createClass(t)}(),f=function(e){function t(e){var n,r=e.menuToggleElement,o=e.parentElement,s=e.controlledMenu,i=e.parentMenu,u=void 0===i?null:i,l=e.initialize,a=void 0===l||l;return _classCallCheck(this,t),n=_callSuper(this,t,[{menuToggleElement:r,parentElement:o,controlledMenu:s,parentMenu:u}]),a&&n.initialize(),n}return _inherits(t,c),_createClass(t,[{key:"_setAriaAttributes",value:function(){_superPropGet(t,"_setAriaAttributes",this,3)([]),a("button",{toggle:this.dom.toggle})||this.dom.toggle.setAttribute("role","button"),this.dom.toggle.setAttribute("aria-controls",this.elements.controlledMenu.dom.menu.id)}},{key:"open",value:function(){this.closeSiblings(),_superPropGet(t,"open",this,3)([])}},{key:"preview",value:function(){this.closeSiblings(),_superPropGet(t,"preview",this,3)([])}},{key:"close",value:function(){this.isOpen&&this.closeChildren(),_superPropGet(t,"close",this,3)([])}}])}(),y=function(e){function n(e){var r,o=e.menuElement,s=e.menuItemSelector,i=void 0===s?"li":s,u=e.menuLinkSelector,l=void 0===u?"a":u,a=e.submenuItemSelector,c=void 0===a?"li:has(ul)":a,m=e.submenuToggleSelector,h=void 0===m?"button":m,d=e.submenuSelector,p=void 0===d?"ul":d,y=e.controllerElement,g=void 0===y?null:y,_=e.containerElement,b=void 0===_?null:_,M=e.openClass,C=void 0===M?"show":M,E=e.closeClass,T=void 0===E?"hide":E,I=e.transitionClass,k=void 0===I?"transitioning":I,S=e.transitionDuration,w=void 0===S?250:S,D=e.openDuration,L=void 0===D?-1:D,A=e.closeDuration,O=void 0===A?-1:A,P=e.isTopLevel,x=void 0===P||P,K=e.parentMenu,z=void 0===K?null:K,F=e.hoverType,j=void 0===F?"off":F,G=e.hoverDelay,N=void 0===G?250:G,R=e.enterDelay,H=void 0===R?-1:R,q=e.leaveDelay,U=void 0===q?-1:q,V=e.optionalKeySupport,W=void 0!==V&&V,B=e.prefix,Z=void 0===B?"am-":B,$=e.initialize,Q=void 0===$||$;return _classCallCheck(this,n),r=_callSuper(this,n,[{menuElement:o,menuItemSelector:i,menuLinkSelector:l,submenuItemSelector:c,submenuToggleSelector:h,submenuSelector:p,controllerElement:g,containerElement:b,openClass:C,closeClass:T,transitionClass:k,transitionDuration:w,openDuration:L,closeDuration:O,isTopLevel:x,parentMenu:z,hoverType:j,hoverDelay:N,enterDelay:H,leaveDelay:U,prefix:Z}]),t(r,"_MenuType",n),t(r,"_MenuItemType",v),t(r,"_MenuToggleType",f),t(r,"_currentChild",-1),t(r,"_optionalSupp
1ort",!1),r._optionalSupport=W,Q&&r.initialize(),r}return _inherits(n,p),_createClass(n,[{key:"initialize",value:function(){try{_superPropGet(n,"initialize",this,3)([]),this._handleFocus(),this._handleClick(),this._handleHover(),this._handleKeydown(),this._handleKeyup()}catch(e){console.error(e)}}},{key:"optionalKeySupport",get:function(){return this.isTopLevel?this._optionalSupport:this.elements.rootMenu.optionalKeySupport},set:function(e){s("boolean",{optionalKeySupport:e}),this._optionalSupport=e}},{key:"_validate",value:function(){var e=_superPropGet(n,"_validate",this,3)([]),t=s("boolean",{optionalKeySupport:this._optionalSupport});return t.status||(this._errors.push(t.error.message),e=!1),e}},{key:"_handleClick",value:function(){var e=this;_superPropGet(n,"_handleClick",this,3)([]),document.addEventListener("pointerup",function(t){"none"!==e.focusState&&(e.currentEvent="mouse",!e.dom.menu.contains(t.target)&&!e.dom.menu!==t.target&&(e.closeChildren(),e.blur(),e.elements.controller&&e.elements.controller.close(),e.elements.rootMenu.hasOpened=!1))})}},{key:"_handleKeydown",value:function(){var e=this;_superPropGet(n,"_handleKeydown",this,3)([]),this.dom.menu.addEventListener("keydown",function(t){e.currentEvent="keyboard";var n=h(t);if("self"===e.focusState){(["Space","Enter"].includes(n)||e.optionalKeySupport&&["ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End"].includes(n)||e.elements.controller&&["Escape"].includes(n)||e.elements.parentMenu&&["Escape"].includes(n))&&d(t)}})}},{key:"_handleKeyup",value:function(){var e=this;_superPropGet(n,"_handleKeyup",this,3)([]),this.dom.menu.addEventListener("keyup",function(t){e.currentEvent="keyboard";var n=h(t);"self"===e.focusState&&("Space"===n||"Enter"===n?(d(t),e.currentMenuItem.isSubmenuItem?e.currentMenuItem.elements.toggle.isOpen?e.currentMenuItem.elements.toggle.close():e.currentMenuItem.elements.toggle.preview():e.currentMenuItem.dom.link.click()):"Escape"===n?e.elements.submenuToggles.some(function(e){return e.isOpen})?(d(t),e.closeChildren()):e.elements.parentMenu?(d(t),e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.closeChildren(),e.elements.parentMenu.focusCurrentChild()):e.isTopLevel&&e.elements.controller&&e.elements.controller.isOpen&&(e.elements.controller.close(),e.focusController()):e.optionalKeySupport&&("ArrowDown"===n||"ArrowRight"===n?(d(t),e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.childMenu.focusFirstChild()):e.focusNextChild()):"ArrowUp"===n||"ArrowLeft"===n?(d(t),e.focusPreviousChild()):"Home"===n?(d(t),e.focusFirstChild()):"End"===n&&(d(t),e.focusLastChild())))})}}])}(),g=function(e){function t(e){var n,r=e.menuItemElement,o=e.menuLinkElement,s=e.parentMenu,i=e.isSubmenuItem,u=void 0!==i&&i,l=e.childMenu,a=void 0===l?null:l,c=e.toggle,m=void 0===c?null:c,h=e.initialize,d=void 0===h||h;return _classCallCheck(this,t),n=_callSuper(this,t,[{menuItemElement:r,menuLinkElement:o,parentMenu:s,isSubmenuItem:u,childMenu:a,toggle:m}]),d&&n.initialize(),n}return _inherits(t,m),_createClass(t,[{key:"initialize",value:function(){_superPropGet(t,"initialize",this,3)([]),this.dom.item.setAttribute("role","none"),this.dom.link.setAttribute("role","menuitem"),this.dom.link.tabIndex=-1}},{key:"focus",value:function(){_superPropGet(t,"focus",this,3)([]),this.elements.parentMenu.isTopLevel&&(this.dom.link.tabIndex=0)}},{key:"blur",value:function(){_superPropGet(t,"blur",this,3)([]),this.elements.parentMenu.isTopLevel&&(this.dom.link.tabIndex=-1)}}])}(),_=function(e){function t(e){var n,r=e.menuToggleElement,o=e.parentElement,s=e.controlledMenu,i=e.parentMenu,u=void 0===i?null:i,l=e.initialize,a=void 0===l||l;return _classCallCheck(this,t),n=_callSuper(this,t,[{menuToggleElement:r,parentElement:o,controlledMenu:s,parentMenu:u}]),a&&n.initialize(),n}return _inherits(t,c),_createClass(t,[{key:"_setAriaAttributes",value:function(){_superPropGet(t,"_setAriaAttributes",this,3)([]),this.dom.toggle.setAttribute("aria-haspopup","true")}},{key:"open",value:function(){this.closeSiblings(),_superPropGet(t,"open",this,3)([])}},{key:"preview",value:function(){this.closeSiblings(),_superPropGet(t,"preview",this,3)([])}},{key:"close",value:function(){this.isOpen&&(this.closeChildren(),this.elements.parentMenu&&this.elements.parentMenu.focu
1sCurrentChild()),_superPropGet(t,"close",this,3)([])}}])}(),b=function(e){function n(e){var r,o=e.menuElement,s=e.menuItemSelector,i=void 0===s?"li":s,u=e.menuLinkSelector,l=void 0===u?"a":u,a=e.submenuItemSelector,c=void 0===a?"li:has(ul)":a,m=e.submenuToggleSelector,h=void 0===m?"a":m,d=e.submenuSelector,p=void 0===d?"ul":d,v=e.controllerElement,f=void 0===v?null:v,y=e.containerElement,b=void 0===y?null:y,M=e.openClass,C=void 0===M?"show":M,E=e.closeClass,T=void 0===E?"hide":E,I=e.transitionClass,k=void 0===I?"transitioning":I,S=e.transitionDuration,w=void 0===S?250:S,D=e.isTopLevel,L=void 0===D||D,A=e.parentMenu,O=void 0===A?null:A,P=e.hoverType,x=void 0===P?"off":P,K=e.hoverDelay,z=void 0===K?250:K,F=e.enterDelay,j=void 0===F?-1:F,G=e.leaveDelay,N=void 0===G?-1:G,R=e.prefix,H=void 0===R?"am-":R,q=e.initialize,U=void 0===q||q;return _classCallCheck(this,n),r=_callSuper(this,n,[{menuElement:o,menuItemSelector:i,menuLinkSelector:l,submenuItemSelector:c,submenuToggleSelector:h,submenuSelector:p,controllerElement:f,containerElement:b,openClass:C,closeClass:T,transitionClass:k,transitionDuration:w,isTopLevel:L,parentMenu:O,hoverType:x,hoverDelay:z,enterDelay:j,leaveDelay:N,prefix:H}]),t(r,"_MenuType",n),t(r,"_MenuItemType",g),t(r,"_MenuToggleType",_),U&&r.initialize(),r}return _inherits(n,p),_createClass(n,[{key:"initialize",value:function(){try{_superPropGet(n,"initialize",this,3)([]),this.isTopLevel?this.dom.menu.setAttribute("role","menubar"):this.dom.menu.setAttribute("role","menu"),this._handleFocus(),this._handleClick(),this._handleHover(),this._handleKeydown(),this._handleKeyup(),this.isTopLevel&&(this.elements.menuItems[0].dom.link.tabIndex=0,this.elements.controller&&this.elements.controller.dom.toggle.removeAttribute("aria-haspopup"))}catch(e){console.error(e)}}},{key:"_handleClick",value:function(){var e=this;_superPropGet(n,"_handleClick",this,3)([]),document.addEventListener("pointerup",function(t){"none"!==e.focusState&&(e.currentEvent="mouse",!e.dom.menu.contains(t.target)&&!e.dom.menu!==t.target&&(e.closeChildren(),e.blur(),e.elements.controller&&e.elements.controller.close(),e.elements.rootMenu.hasOpened=!1))})}},{key:"_handleKeydown",value:function(){var e=this;_superPropGet(n,"_handleKeydown",this,3)([]),this.dom.menu.addEventListener("keydown",function(t){e.currentEvent="keyboard";var n=h(t);if("Tab"===n&&("none"!==e.elements.rootMenu.focusState?(e.elements.rootMenu.blur(),e.elements.rootMenu.closeChildren()):e.elements.rootMenu.focus()),"Character"===n)d(t);else if(e.isTopLevel){if("self"===e.focusState){(["Space","Enter","ArrowRight","ArrowLeft","Home","End"].includes(n)||e.currentMenuItem.isSubmenuItem&&["ArrowDown","ArrowUp"].includes(n)||e.elements.controller&&["Escape"].includes(n))&&d(t)}}else["Space","Enter","Escape","ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(n)&&d(t)})}},{key:"_handleKeyup",value:function(){var e=this;_superPropGet(n,"_handleKeyup",this,3)([]),this.dom.menu.addEventListener("keyup",function(t){e.currentEvent="keyboard";var n=h(t),r=t.altKey,o=t.crtlKey,s=t.metaKey;if("Character"!==n||(r||o||s))if(e.isTopLevel){if("self"===e.focusState)if("Space"===n||"Enter"===n)d(t),e.currentMenuItem.isSubmenuItem?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame(function(){e.currentMenuItem.elements.childMenu.focusFirstChild()})):e.currentMenuItem.dom.link.click();else if("ArrowRight"===n){d(t);var i=e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen;e.focusNextChild(),i&&(e.currentMenuItem.isSubmenuItem?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.preview()):e.closeChildren())}else if("ArrowLeft"===n){d(t);var u=e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen;e.focusPreviousChild(),u&&(e.currentMenuItem.isSubmenuItem?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.preview()):e.closeChildren())}else"ArrowDown"===n?e.currentMenuItem.isSubmenuItem&&(d(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame(function(){e.currentMenuItem.elements.childMenu.focu
1sFirstChild()})):"ArrowUp"===n?e.currentMenuItem.isSubmenuItem&&(d(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame(function(){e.currentMenuItem.elements.childMenu.focusLastChild()})):"Home"===n?(d(t),e.focusFirstChild()):"End"===n?(d(t),e.focusLastChild()):"Escape"===n&&(e.elements.submenuToggles.some(function(e){return e.isOpen})?(d(t),e.closeChildren()):e.isTopLevel&&e.elements.controller&&e.elements.controller.isOpen&&(d(t),e.elements.controller.close(),e.focusController()))}else"Space"===n||"Enter"===n?(d(t),e.currentMenuItem.isSubmenuItem?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame(function(){e.currentMenuItem.elements.childMenu.focusFirstChild()})):e.currentMenuItem.dom.link.click()):"Escape"===n?(d(t),e.elements.rootMenu.closeChildren(),e.elements.rootMenu.focusCurrentChild()):"ArrowRight"===n?e.currentMenuItem.isSubmenuItem?(d(t),e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.toggle.open(),requestAnimationFrame(function(){e.currentMenuItem.elements.childMenu.focusFirstChild()})):(d(t),e.elements.rootMenu.closeChildren(),e.elements.rootMenu.focusNextChild(),e.elements.rootMenu.currentMenuItem.isSubmenuItem&&e.elements.rootMenu.currentMenuItem.elements.toggle.preview()):"ArrowLeft"===n?e.elements.parentMenu.currentMenuItem.isSubmenuItem&&(d(t),e.elements.parentMenu.currentMenuItem.elements.toggle.close(),e.elements.parentMenu.focusCurrentChild(),e.elements.parentMenu===e.elements.rootMenu&&(e.elements.rootMenu.closeChildren(),e.elements.rootMenu.focusPreviousChild(),e.elements.rootMenu.currentMenuItem.isSubmenuItem&&(e.elements.rootMenu.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.elements.rootMenu.currentMenuItem.elements.toggle.preview()))):"ArrowDown"===n?(d(t),e.focusNextChild()):"ArrowUp"===n?(d(t),e.focusPreviousChild()):"Home"===n?(d(t),e.focusFirstChild()):"End"===n&&(d(t),e.focusLastChild());else d(t),e.elements.rootMenu.currentEvent="character",e.focusNextChildWithCharacter(t.key)})}},{key:"focusNextChild",value:function(){this.currentChild===this.elements.menuItems.length-1?this.focusFirstChild():this.focusChild(this.currentChild+1)}},{key:"focusPreviousChild",value:function(){0===this.currentChild?this.focusLastChild():this.focusChild(this.currentChild-1)}},{key:"focusNextChildWithCharacter",value:function(e){for(var t=e.toLowerCase(),n=this.currentChild+1,r=!1;!r&&n<this.elements.menuItems.length;){(this.elements.menuItems[n].dom.item.innerText?this.elements.menuItems[n].dom.item.innerText:this.elements.menuItems[n].dom.item.textContent).replace(/[\s]/g,"").toLowerCase().charAt(0)===t&&(r=!0,this.focusChild(n)),n++}}}])}(),M=function(e){function n(e){var r,o=e.menuItemElement,s=e.menuLinkElement,i=e.parentMenu,u=e.isSubmenuItem,l=void 0!==u&&u,a=e.childMenu,c=void 0===a?null:a,m=e.toggle,h=void 0===m?null:m,d=e.initialize,p=void 0===d||d,v=e.submenuSibling,f=void 0===v?null:v;return _classCallCheck(this,n),r=_callSuper(this,n,[{menuItemElement:o,menuLinkElement:s,parentMenu:i,isSubmenuItem:l,childMenu:c,toggle:h}]),t(r,"_elements",{parentMenu:null,childMenu:null,toggle:null,sibling:null}),r._elements.parentMenu=i,r._elements.childMenu=c,r._elements.toggle=h,r._elements.sibling=f,p&&r.initialize(),r}return _inherits(n,m),_createClass(n)}(),C=function(e){function t(e){var n,r=e.menuToggleElement,o=e.parentElement,s=e.controlledMenu,i=e.parentMenu,u=void 0===i?null:i,l=e.initialize,a=void 0===l||l;return _classCallCheck(this,t),n=_callSuper(this,t,[{menuToggleElement:r,parentElement:o,controlledMenu:s,parentMenu:u}]),a&&n.initialize(),n}return _inherits(t,c),_createClass(t,[{key:"_setAriaAttributes",value:function(){_superPropGet(t,"_setAriaAttributes",this,3)([]),a("button",{toggle:this.dom.toggle})||this.dom.toggle.setAttribute("role","button"),this.dom.toggle.setAttribute("aria-controls",this.elements.controlledMenu.dom.menu.id)}},{key:"open",value:function(){this.closeSiblings(),_superPropGet(t,"open",this,3)([])}},{key:"preview",value:function(){this.closeSiblings(),_superPropGet(t,"preview",this,3)([])}},{key:"close",value:function(){this.isOpen&&this.closeChildren(),_superPropGet(t,"close",this,3)([])}}])}(),E=function(e){function n(e){var r,o=e.menuElement,s=e.menuItemSelector,i=void 0===s?"li":s,u=e.menuLinkSelector,l=void 0===u?"a":u,a=e.submenuItemSelector,c=void 0===a?"li:has(ul)":a,m=e.submenuToggleSelector,h=void 0===m?"button":m,d=e.submenuSelector,p=void 0===d?"ul":d,v=e.submenuSubtoggleSelector,f=void 0===v?"a":v,y=e.controllerElement,g=void 0===y?null:y,_=e.containerElement,b=void 0===_?null:_,E=e.openClass,T=void 0===E?"show":E,I=e.closeClass,k=void 0===I?"hide":I,S=e.transitionClass,w=void 0===S?"transitioning":S,D=e.transitionDuration,L=void 0===D?250:D,A=e.isTopLevel,O=void 0===A||A,P=e.parentMenu,x=void 0===P?null:P,K=e.hoverType,z=void 0===K?"off":K,F=e.hoverDelay,j=void 0===F?250:F,G=e.enterDelay,N=void 0===G?-1:G,R=e.leaveDelay,H=void 0===R?-1:R,q=e.optionalKeySupport,U=void 0!==q&&q,V=e.prefix,W=void 0===V?"am-":V,B=e.initialize,Z=void 0===B||B;return _classCallCheck(this,n),r=_callSuper(this,n,[{menuElement:o,menuItemSelector:i,menuLinkSelector:l,submenuItemSelector:c,submenuSelector:p,submenuToggleSelector:h,controllerElement:g,containerElement:b,openClass:T,closeClass:k,transitionClass:w,transitionDuration:L,isTopLevel:O,parentMenu:x,hoverType:z,hoverDelay:j,enterDelay:N,leaveDelay:H,prefix:W}]),t(r,"_MenuType",n),t(r,"_MenuItemType",M),t(r,"_MenuToggleType",C),t(r,"_currentChild",-1),t(r,"_selectors",{menuItems:"",menuLinks:"",submenuItems:"",submenuToggles:"",submenus:"",submenuSubtoggles:""}
1),t(r,"_optionalSupport",!1),r._optionalSupport=U,r._selectors.menuItems=i,r._selectors.submenuItems=c,r._selectors.submenuToggles=h,r._selectors.submenus=p,r._selectors.submenuSubtoggles=f,r._selectors.menuLinks=_toConsumableArray(new Set([l,h])).join(","),Z&&r.initialize(),r}return _inherits(n,p),_createClass(n,[{key:"initialize",value:function(){try{_superPropGet(n,"initialize",this,3)([]),this._handleFocus(),this._handleClick(),this._handleHover(),this._handleKeydown(),this._handleKeyup()}catch(e){console.error(e)}}},{key:"optionalKeySupport",get:function(){return this.isTopLevel?this._optionalSupport:this.elements.rootMenu.optionalKeySupport},set:function(e){s("boolean",{optionalKeySupport:e}),this._optionalSupport=e}},{key:"_createChildElements",value:function(){var e=this;this.dom.menuItems.forEach(function(t){var n,r,o=t.querySelector(e.selectors.menuLinks);if(e.dom.submenuItems.includes(t)){var s=t.querySelector(e.selectors.submenuToggles),i=t.querySelector(e.selectors.submenus),u=new e._MenuType({menuElement:i,menuItemSelector:e.selectors.menuItems,menuLinkSelector:e.selectors.menuLinks,submenuItemSelector:e.selectors.submenuItems,submenuToggleSelector:e.selectors.submenuSubtoggles,submenuSelector:e.selectors.submenus,submenuSubtoggleSelector:e.selectors.submenuSubtoggles,openClass:e.openClass,closeClass:e.closeClass,transitionClass:e.transitionClass,isTopLevel:!1,parentMenu:e,hoverType:e.hoverType,hoverDelay:e.hoverDelay,enterDelay:e.enterDelay,leaveDelay:e.leaveDelay}),l=new e._MenuToggleType({menuToggleElement:s,parentElement:t,controlledMenu:u,parentMenu:e});e._elements.submenuToggles.push(l),s!==o?(r=new e._MenuItemType({menuItemElement:t,menuLinkElement:s,parentMenu:e,isSubmenuItem:!0,childMenu:u,toggle:l}),n=new e._MenuItemType({menuItemElement:t,menuLinkElement:o,parentMenu:e,submenuSibling:r})):n=new e._MenuItemType({menuItemElement:t,menuLinkElement:o,parentMenu:e,isSubmenuItem:!0,childMenu:u,toggle:l})}else n=new e._MenuItemType({menuItemElement:t,menuLinkElement:o,parentMenu:e});e._elements.menuItems.push(n),_typeof(r)<"u"&&e._elements.menuItems.push(r)})}},{key:"_validate",value:function(){var e=_superPropGet(n,"_validate",this,3)([]),t=i({submenuSubtoggleSelector:this._selectors.submenuSubtoggles});t.status||(this._errors.push(t.error.message),e=!1);var r=s("boolean",{optionalKeySupport:this._optionalSupport});return r.status||(this._errors.push(r.error.message),e=!1),e}},{key:"_handleClick",value:function(){var e=this;_superPropGet(n,"_handleClick",this,3)([]),document.addEventListener("pointerup",function(t){"none"!==e.focusState&&(e.currentEvent="mouse",!e.dom.menu.contains(t.target)&&!e.dom.menu!==t.target&&(e.closeChildren(),e.blur(),e.elements.controller&&e.elements.controller.close(),e.elements.rootMenu.hasOpened=!1))})}},{key:"_handleHover",value:function(){var e=this;this.elements.menuItems.forEach(function(t,n){t.dom.link.addEventListener("pointerenter",function(r){if("pen"!==r.pointerType&&"touch"!==r.pointerType)if("on"===e.hoverType){e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusChild(n);var o=t.isSubmenuItem?t.elements.toggle:null;if(null!==t.elements.sibling&&(o=t.elements.sibling.elements.toggle),null===o)return;e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){o.preview()},e.enterDelay)):o.preview()}else if("dynamic"===e.hoverType&&(e.currentChild=n,(!e.isTopLevel||"none"!==e.focusState)&&(e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusCurrentChild()),!e.isTopLevel||e.hasOpened)){e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusCurrentChild();var s=t.isSubmenuItem?t.elements.toggle:null;null!==t.elements.sibling&&(s=t.elements.sibling.elements.toggle),null!==s?e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){s.preview()},e.enterDelay)):s.preview():e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.closeChildren()},e.enterDelay)):e.closeChildren()}}),t.isSubmenuItem&&(t.dom.item.addEventListener("pointerleave",function(n){"pen"===n.pointerType||"touch"===n.pointerType||("on"===e.hoverType?e.leaveDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.currentEvent="mou
1se",t.elements.toggle.close()},e.leaveDelay)):(e.currentEvent="mouse",t.elements.toggle.close()):"dynamic"===e.hoverType&&(e.leaveDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.currentEvent="mouse"},e.leaveDelay)):e.currentEvent="mouse"))}),t.dom.item.addEventListener("pointerenter",function(n){"pen"===n.pointerType||"touch"===n.pointerType||t.isSubmenuItem&&("on"===e.hoverType||"dynamic"===e.hoverType)&&e.leaveDelay>0&&e._clearTimeout()}))})}},{key:"_handleKeydown",value:function(){var e=this;_superPropGet(n,"_handleKeydown",this,3)([]),this.dom.menu.addEventListener("keydown",function(t){e.currentEvent="keyboard";var n=h(t);if("self"===e.focusState){(["Space","Enter"].includes(n)||e.optionalKeySupport&&["ArrowUp","ArrowRight","ArrowDown","ArrowLeft","Home","End"].includes(n)||e.elements.controller&&["Escape"].includes(n)||e.elements.parentMenu&&["Escape"].includes(n))&&d(t)}})}},{key:"_handleKeyup",value:function(){var e=this;_superPropGet(n,"_handleKeyup",this,3)([]),this.dom.menu.addEventListener("keyup",function(t){e.currentEvent="keyboard";var n=h(t);"self"===e.focusState&&("Space"===n||"Enter"===n?(d(t),e.currentMenuItem.isSubmenuItem?e.currentMenuItem.elements.toggle.isOpen?e.currentMenuItem.elements.toggle.close():e.currentMenuItem.elements.toggle.preview():e.currentMenuItem.dom.link.click()):"Escape"===n?e.elements.submenuToggles.some(function(e){return e.isOpen})?(d(t),e.closeChildren()):e.elements.parentMenu?(d(t),e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.closeChildren(),e.elements.parentMenu.focusCurrentChild()):e.isTopLevel&&e.elements.controller&&e.elements.controller.isOpen&&(e.elements.controller.close(),e.focusController()):e.optionalKeySupport&&("ArrowDown"===n||"ArrowRight"===n?(d(t),e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen?(e.currentMenuItem.elements.childMenu.currentEvent="keyboard",e.currentMenuItem.elements.childMenu.focusFirstChild()):e.focusNextChild()):"ArrowUp"===n||"ArrowLeft"===n?(d(t),e.focusPreviousChild()):"Home"===n?(d(t),e.focusFirstChild()):"End"===n&&(d(t),e.focusLastChild())))})}}])}(),T=function(e){function t(e){var n,r=e.menuItemElement,o=e.menuLinkElement,s=e.parentMenu,i=e.isSubmenuItem,u=void 0!==i&&i,l=e.childMenu,a=void 0===l?null:l,c=e.toggle,m=void 0===c?null:c,h=e.initialize,d=void 0===h||h;return _classCallCheck(this,t),n=_callSuper(this,t,[{menuItemElement:r,menuLinkElement:o,parentMenu:s,isSubmenuItem:u,childMenu:a,toggle:m}]),d&&n.initialize(),n}return _inherits(t,m),_createClass(t,[{key:"initialize",value:function(){_superPropGet(t,"initialize",this,3)([]),this.dom.item.setAttribute("role","none"),this.dom.link.setAttribute("role","treeitem"),this.dom.link.tabIndex=-1}},{key:"focus",value:function(){_superPropGet(t,"focus",this,3)([]),this.dom.link.tabIndex=0}},{key:"blur",value:function(){_superPropGet(t,"blur",this,3)([]),this.dom.link.tabIndex=-1}}])}(),I=function(e){function t(e){var n,r=e.menuToggleElement,o=e.parentElement,s=e.controlledMenu,i=e.parentMenu,u=void 0===i?null:i,l=e.initialize,a=void 0===l||l;return _classCallCheck(this,t),n=_callSuper(this,t,[{menuToggleElement:r,parentElement:o,controlledMenu:s,parentMenu:u}]),a&&n.initialize(),n}return _inherits(t,c),_createClass(t,[{key:"initialize",value:function(){this._setIds(),this._setAriaAttributes(),"true"===this.dom.toggle.getAttribute("aria-expanded")?this.open():this._collapse(!1)}},{key:"_setAriaAttributes",value:function(){"true"!==this.dom.toggle.getAttribute("aria-expanded")&&this.dom.toggle.setAttribute("aria-expanded","false"),this.elements.controlledMenu.dom.menu.setAttribute("aria-labelledby",this.dom.toggle.id),this.dom.toggle.setAttribute("aria-owns",this.elements.controlledMenu.dom.menu.id)}}])}();return{DisclosureMenu:y,Menubar:b,TopLinkDisclosureMenu:E,Treeview:function(e){function n(e){var r,o=e.menuElement,s=e.menuItemSelector,i=void 0===s?"li":s,u=e.menuLinkSelector,l=void 0===u?"a":u,a=e.submenuItemSelector,c=void 0===a?"li:has(ul)":a,m=e.submenuToggleSelector,h=void 0===m?"a":m,d=e.submenuSelector,p=void 0===d?"ul":d,v=e.controllerElement,f=void 0===v?null:v,y=e.containerElement,g=void 0===y?null:y,_=e.openClass,b=void 0===_?"show":_,M=e.closeClass,C=void 0===M?"hide":M,E=e.transitionClass,k=void 0===E?"transitioning":E,S=e.transitionDuration,w=void 0===S?250:S,D=e.isTopLevel,L=void 0===D||D,A=e.parentMenu,O=void 0===A?null:A,P=e.hoverType,x=void 0===P?"off":P,K=e.hoverDelay,z=void 0===K?250:K,F=e.enterDelay,j=void 0===F?-1:F,G=e.leaveDelay,N=void 0===G?-1:G,R=e.prefix,H=void 0===R?"am-":R,q=e.initialize,U=void 0===q||q;return _classCallCheck(this,n),r=_callSuper(this,n,[{menuElement:o,menuItemSelector:i,menuLinkSelector:l,submenuItemSelector:c,submenuToggleSelector:h,submenuSelector:p,controllerElement:f,containerElement:g,openClass:b,closeClass:C,transitionClass:k,transitionDuration:w,isTopLevel:L,parentMenu:O,hoverType:x,hoverDelay:z,enterDelay:j,leaveDelay:N,prefix:H}]),t(r,"_MenuType",n),t(r,"_MenuItemType",T),t(r,"_MenuToggleType",I),U&&r.initialize(),r}return _inherits(n,p),_createClass(n,[{key:"initialize",value:function(){try{_superPropGet(n,"initialize",this,3)([]),this.isTopLevel?(this.dom.menu.setAttribute("role","tree"),this.elements.menuItems[0].dom.link.tabIndex=0):this.dom.menu.setAttribute("role","group"),this._handleFocus(),this._handleClick(),this._handleHover(),this._handleKeydown(),this._handleKeyup(),this.isTopLevel&&this.elements.controller&&this.elements.controller.dom.toggle.removeAttribute("aria-owns")}catch(e){console.error(e)}}},{key:"_handleHover",value:function(){var e=this;
1this.elements.menuItems.forEach(function(t,n){t.dom.link.addEventListener("pointerenter",function(r){"pen"===r.pointerType||"touch"===r.pointerType||("on"===e.hoverType?(e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusChild(n),t.isSubmenuItem&&(e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){t.elements.toggle.preview()},e.enterDelay)):t.elements.toggle.preview())):"dynamic"===e.hoverType&&(e.currentChild=n,(!e.isTopLevel||"none"!==e.focusState)&&(e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusCurrentChild()),(!e.isTopLevel||e.hasOpened)&&(e.currentEvent="mouse",e.elements.rootMenu.blurChildren(),e.focusCurrentChild(),t.isSubmenuItem?e.enterDelay>0?(e._clearTimeout(),e._setTimeout(function(){t.elements.toggle.preview()},e.enterDelay)):t.elements.toggle.preview():e.enterDelay>0&&e._clearTimeout())))}),t.isSubmenuItem&&(t.dom.item.addEventListener("pointerleave",function(t){"pen"===t.pointerType||"touch"===t.pointerType||("on"===e.hoverType?e.leaveDelay>0&&e._clearTimeout():"dynamic"===e.hoverType&&(e.leaveDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.currentEvent="mouse"},e.leaveDelay)):e.currentEvent="mouse"))}),t.dom.item.addEventListener("pointerenter",function(n){"pen"===n.pointerType||"touch"===n.pointerType||t.isSubmenuItem&&("on"===e.hoverType||"dynamic"===e.hoverType)&&e.leaveDelay>0&&e._clearTimeout()})),e.isTopLevel&&e.dom.menu.addEventListener("pointerleave",function(t){"pen"===t.pointerType||"touch"===t.pointerType||"on"===e.hoverType&&(e.leaveDelay>0?(e._clearTimeout(),e._setTimeout(function(){e.closeChildren(),e.blur()},e.leaveDelay)):(e.closeChildren(),e.blur()))})})}},{key:"_handleKeydown",value:function(){var e=this;_superPropGet(n,"_handleKeydown",this,3)([]),this.dom.menu.addEventListener("keydown",function(t){e.currentEvent="keyboard";var n=h(t);if("Tab"===n&&("none"!==e.elements.rootMenu.focusState?e.elements.rootMenu.blur():e.elements.rootMenu.focus()),"self"===e.focusState){(["Space","Enter","ArrowUp","ArrowDown","ArrowLeft","Asterisk","Home","End"].includes(n)||e.currentMenuItem.isSubmenuItem&&["ArrowRight"].includes(n)||e.elements.controller&&["Escape"].includes(n))&&d(t)}})}},{key:"_handleKeyup",value:function(){var e=this;_superPropGet(n,"_handleKeyup",this,3)([]),this.dom.menu.addEventListener("keyup",function(t){e.currentEvent="keyboard";var n=h(t),r=t.altKey,o=t.crtlKey,s=t.metaKey;if("Character"!==n||(r||o||s)){if("self"===e.focusState)if("Enter"===n||"Space"===n)d(t),e.currentMenuItem.isSubmenuItem?e.currentMenuItem.elements.toggle.isOpen?e.currentMenuItem.elements.toggle.close():e.currentMenuItem.elements.toggle.preview():e.currentMenuItem.dom.link.click();else if("Escape"===n)e.isTopLevel&&e.elements.controller&&e.elements.controller.isOpen&&(e.elements.controller.close(),e.focusController());else if("ArrowDown"===n)d(t),e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen?(e.blurCurrentChild(),e.currentMenuItem.elements.childMenu.currentEvent=e.currentEvent,e.currentMenuItem.elements.childMenu.focusFirstChild()):e.isTopLevel||e.currentChild!==e.elements.menuItems.length-1?e.focusNextChild():e.focusParentsNextChild();else if("ArrowUp"===n){d(t);var i=e.elements.menuItems[e.currentChild-1];i&&i.isSubmenuItem&&i.elements.toggle.isOpen?(e.blurCurrentChild(),e.currentChild=e.currentChild-1,e.currentMenuItem.elements.childMenu.currentEvent=e.currentEvent,e.focusChildsLastNode()):e.isTopLevel||0!==e.currentChild?e.focusPreviousChild():(e.blurCurrentChild(),e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.focusCurrentChild())}else"ArrowRight"===n?e.currentMenuItem.isSubmenuItem&&(d(t),e.currentMenuItem.elements.toggle.isOpen?(e.blurCurrentChild(),e.currentMenuItem.elements.childMenu.currentEvent=e.currentEvent,e.currentMenuItem.elements.childMenu.focusFirstChild()):e.currentMenuItem.elements.toggle.preview()):"ArrowLeft"===n?(d(t),e.currentMenuItem.isSubmenuItem&&e.currentMenuItem.elements.toggle.isOpen?(e.currentMenuItem.elements.childMenu.blurCurrentChild(),e.currentMenuItem.elements.toggle.close()):e.isTopLevel||(e.blurCurrentChild(),e.elements.parentMenu.currentEvent=e.currentEvent,e.elements.parentMenu.focu
1sCurrentChild())):"Home"===n?(d(t),e.blurCurrentChild(),e.elements.rootMenu.focusFirstChild()):"End"===n?(d(t),e.blurCurrentChild(),e.elements.rootMenu.focusLastNode()):"Asterisk"===n&&(d(t),e.openChildren())}else d(t),e.elements.rootMenu.currentEvent="character",e.focusNextNodeWithCharacter(t.key)})}},{key:"focusLastNode",value:function(){var e=this.elements.menuItems.length-1,t=this.elements.menuItems[e];t.isSubmenuItem&&t.elements.toggle.isOpen?(this.currentChild=e,t.elements.childMenu.currentEvent=this.currentEvent,t.elements.childMenu.focusLastNode()):this.focusLastChild()}},{key:"openChildren",value:function(){this.elements.submenuToggles.forEach(function(e){return e.preview()})}},{key:"focusNextNodeWithCharacter",value:function(e){for(var t=e.toLowerCase(),n=function e(t){var n=[];return t.elements.menuItems.forEach(function(t){n.push(t),t.isSubmenuItem&&t.elements.toggle.isOpen&&(n=[].concat(_toConsumableArray(n),_toConsumableArray(e(t.elements.toggle.elements.controlledMenu))))}),n}(this.elements.rootMenu),r=n.indexOf(this.currentMenuItem)+1,o=[].concat(_toConsumableArray(n.slice(r)),_toConsumableArray(n.slice(0,r))),s=0,i=!1;!i&&s<o.length;){if((o[s].dom.item.innerText?o[s].dom.item.innerText:o[s].dom.item.textContent).replace(/[\s]/g,"").toLowerCase().charAt(0)===t){i=!0;var u=o[s].elements.parentMenu,l=u.elements.menuItems.indexOf(o[s]);this.elements.rootMenu.blurChildren(),u.focusChild(l)}s++}}},{key:"focusParentsNextChild",value:function(){this.elements.parentMenu&&(this.elements.parentMenu.currentEvent=this.currentEvent,this.elements.parentMenu.currentChild===this.elements.parentMenu.elements.menuItems.length-1?(this.elements.parentMenu.blurCurrentChild(),this.elements.parentMenu.focusParentsNextChild()):(this.blurChildren(),this.elements.parentMenu.focusNextChild()))}},{key:"focusChildsLastNode",value:function(){this.currentMenuItem.elements.childMenu.currentEvent=this.currentEvent,this.currentMenuItem.elements.childMenu.focusLastChild(),this.currentMenuItem.elements.childMenu.currentMenuItem.isSubmenuItem&&this.currentMenuItem.elements.childMenu.currentMenuItem.elements.toggle.isOpen&&(this.currentMenuItem.elements.childMenu.blurCurrentChild(),this.currentMenuItem.elements.childMenu.focusChildsLastNode())}}])}()}}();
2//# sourceMappingURL=../../../maps/common/accessible-menu/4.2.2/accessible-menu.esc5-pack.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.