1"use strict";class MonUI{constructor(t){this.idName=t,this.defaultOptions={start:0},this.defaultTabsOptions={active:"click",vertical:!1},this.defaultAccordionOptions={collapsible:!1},this.defaultToggleOptions={initClosed:!1},this.uiElements={button:".monui-button",panel:".monui-panel",tabsList:".monui-tabs-list"}}_stopVideos(t){t.querySelectorAll('video, iframe[src*="youtube"], iframe[src*="vimeo"]').forEach(t=>{if("VIDEO"===t.tagName)t.pause();else{const e=t.src;t.src=e}})}_closeNodes(t,e,i,o=null){i.querySelectorAll(this.uiElements.button).forEach((i,o)=>i.setAttribute(e,t===o)),i.querySelectorAll(this.uiElements.panel).forEach((e,i)=>{e.setAttribute("aria-hidden",t!==i),this._stopVideos(e)}),"function"==typeof o&&o()}_toggleNode(t,e,i=null){if(null===t.getAttribute("aria-controls"))return console.log("No aria-controls found in button");const o="true"===t.getAttribute(e),n=document.querySelector("#"+t.getAttribute("aria-controls"));t.setAttribute(e,!o),n.setAttribute("aria-hidden",o),"function"==typeof i&&i(),this._stopVideos(n)}_keypressHandler(t,e={}){const i={prev:"ArrowLeft",next:"ArrowRight",...e};t.addEventListener("keydown",e=>{let o=!1;const n=Array.from(t.querySelectorAll("button")),s=n[0],r=n[n.length-1];switch(e.key){case"Home":o=!0,s.focus();break;case"End":o=!0,r.focus();break;case i.prev:o=!0,function(){const t=n.indexOf(document.activeElement);if(t>0)n[t-1].focus()}();break;case i.next:o=!0,function(){const t=n.indexOf(document.activeElement);if(t<n.length-1)n[t+1].focus()}();break;case"Tab":o=(()=>{const i=t.querySelectorAll('[aria-selected="true"]'),o=t.querySelectorAll('[aria-hidden="false"] a');if(0===o.length)return!1;if(0===i.length)return!1;const n=document.activeElement===i[0],s=document.activeElement===o[0];return n&&!e.shiftKey?(o[0].focus(),n):!(!s||!e.shiftKey)&&(i[0].focus(),s)})()}o&&(e.stopPropagation(),e.preventDefault())})}tabs(t={}){const e={...this.defaultOptions,...this.defaultTabsOptions,...t},i=document.querySelector(this.idName);if(null===i)return console.log("No id found in tabs container");const o=i.querySelector(this.uiElements.tabsList),n=i.querySelectorAll(this.uiElements.button),s=i.querySelectorAll(this.uiElements.panel);o.setAttribute("role","tablist"),i.querySelector(this.uiElements.tabsList).setAttribute("aria-orientation",e.vertical?"vertical":"horizontal"),i.style.setProperty("--active-panel",e.start),i.style.setProperty("--total-panels",s.length),n.forEach((t,o)=>{t.setAttribute("aria-selected",o===e.start),t.setAttribute("role","tab"),t.addEventListener(e.active,()=>this._closeNodes(o,"aria-selected",i))}),s.forEach((t,i)=>{t.setAttribute("aria-hidden",i!==e.start),t.setAttribute("role","tabpanel")}),this._keypressHandler(i,e.vertical?{prev:"ArrowUp",next:"ArrowDown"}:{}),console.log("MonUI: init ui-tabs in "+this.idName+" at: "+window.innerWidth+"px")}accordion(t={}){const e={...this.defaultOptions,...this.defaultAccordionOptions,...t},i=document.querySelector(this.idName);if(null===i)return console.log("No id found in accordion container");const o=i.querySelectorAll(this.uiElements.button),n=i.querySelectorAll(this.uiElements.panel);i.style.setProperty("--active-panel",e.start),i.style.setProperty("--total-panels",n.length),o.forEach((t,o)=>{const n=()=>i.style.setProperty("--active-panel",o);t.setAttribute("aria-expanded",o===e.start),t.addEventListener("click",()=>e.collapsible?this._toggleNode(t,"aria-expanded",n):this._closeNodes(o,"aria-expanded",i,n))}),n.forEach((t,i)=>{t.setAttribute("role","region"),t.setAttribute("aria-hidden",i!==e.start)}),console.log("MonUI: init ui-accordion in "+this.idName+" at: "+window.innerWidth+"px")}togglePanel(t={}){const e={...this.defaultOptions,...this.defaultToggleOptions,...t},i=document.querySelector(this.idName);if(null===i)return console.log("No id found in toggle container");const o=i.querySelector(this.uiElements.button),n=i.querySelector(this.uiElements.panel);o.setAttribute("aria-expanded",!e.initClosed),o.addEventListener("click",()=>this._toggleNode(o,"aria-expanded")),n.setAttribute("role","region"),n.setAttribute("aria-hidden",e.initClosed),i.addEventListener("keydown",t=>{if("false"!==o.getAttribute("aria-expanded")){if("Escape"==t.key)return t.preventDefault(),this._toggleNode(o,"aria-expanded");if("Tab"==t.key){const e=i.querySelectorAll("button, a, input"),o=e[0],n=e[e.length-1];if(!t.shiftKey&&document.activeElement===n)return t.preventDefault(),o.focus();if(t.shiftKey&&document.activeElement===o)return t.preventDefault(),n.focus()}}}),console.log("MonUI: init ui-toggle-panel in "+this.idName+" at: "+window.innerWidth+"px")}} 2//# sourceMappingURL=../../../maps/common/monui/1.0/monui-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.