1/******/(()=>{// webpackBootstrap 2/******/"use strict"; 3/******/var e={ 4/***/29848(e,t,n){ 5/* harmony import */var s=n(62513); 6/* eslint @wordpress/no-global-active-element: 0 -- Not relevant out of React. */ 7/** 8 * Internal dependencies 9 */ 10/** 11 * @module sensei-modal 12 * @description Adds a basic suport for modals via "data-sensei-modal-*" attribures on HTML elements. 13 * 14 * @example 15 * The Sensei Modal consists of four basic elements: open, close, content and overlay. 16 * Each of those elements should be denoted with HTML attributes: 17 * - data-sensei-modal-open 18 * - data-sensei-modal-content 19 * - data-sensei-modal-overlay (Optional) 20 * - data-sensei-modal-close (Optional) 21 * The modal declaration should look like something this: 22 * ```html 23 * <div data-sensei-modal> 24 * <button data-sensei-modal-open>Open Modal</button> 25 * <div data-sensei-modal-overlay></div> 26 * <div data-sensei-modal-content> 27 * <h1>Hello Modal!</h1> 28 * <button data-sensei-modal-close>Close Modal</button> 29 * </div> 30 * </div> 31 * ``` 32 */ 33/** 34 * The last focused element in the document. 35 * 36 * @type {Element} 37 */let o=document.activeElement; 38/** 39 * Opens the modal 40 * @param {MouseEvent} ev The click event. 41 */const l=e=>{e?.preventDefault();const t=(0,s/* .querySelectorAncestor */.L)(e.target,"[data-sensei-modal]");if(!t)return; 42// Put element's copy at the end of the body element. 43const n=t.cloneNode(!0);n.setAttribute("data-sensei-modal-clone",""),document.body.appendChild(n),["overlay","close"].forEach(e=>{n.querySelectorAll(`[data-sensei-modal-${e}]`).forEach(e=>{e.addEventListener("click",i)})}), 44// Open the modal. 45// Make sure the elements are opened only after they are painted by 46// the browser first. Otherwise the transition effects do not work. 47window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>{n.setAttribute("data-sensei-modal-is-open",""),document.body.dispatchEvent(new CustomEvent("sensei-modal-open",{detail:n})),o=document.activeElement;const e=n.querySelector("[data-sensei-modal-content]");e&&(e.tabIndex=0,e.focus())}))},i=e=>{e?.preventDefault(),document.querySelectorAll("[data-sensei-modal-clone]").forEach(e=>{e.remove(),document.body.dispatchEvent(new CustomEvent("sensei-modal-close",{detail:e})),o?.focus()})}; 48/** 49 * Closes the opened modal 50 * @param {MouseEvent} ev The click event. 51 */ 52// Init modal when the DOM is fully ready. 53window.addEventListener("load", 54/** 55 * Attach modal events. 56 */ 57function(){ 58// Attach open events. 59document.querySelectorAll("[data-sensei-modal-open]").forEach(e=>{e.addEventListener("click",l)}), 60// Attach close event on Escape key. 61document.addEventListener("keydown",e=>{"Escape"===e.key&&i(e)})}), 62/** 63 * Support for closing the Modal on Esc key. 64 */ 65document.addEventListener("keydown",e=>{["Esc","Escape"].includes(e.key)&&i()})}, 66/***/62513(e,t,n){ 67/** 68 * Finds the first ancestor matching the CSS selector. 69 * 70 * @param {HTMLElement} element The element whose parent you want to retrieve. 71 * @param {string} selector The CSS selector. 72 * @return {HTMLElement|null} The parent element if found or null otherwise. 73 */ 74const s=(e,t="")=>e.parentElement?e.parentElement.matches(t)?e.parentElement:s(e.parentElement,t):null; 75/* harmony export */n.d(t,[ 76/* harmony export */"L",0,/* binding */s 77/* harmony export */])} 78/******/}; 79/************************************************************************/ 80/******/ // The module cache 81/******/const t={}; 82/******/ 83/******/ // The require function 84/******/function n(s){ 85/******/ // Check if module is in cache 86/******/const o=t[s]; 87/******/if(void 0!==o) 88/******/return o.exports; 89/******/ 90/******/ // Create a new module (and put it into the cache) 91/******/const l=t[s]={ 92/******/ // no module.id needed 93/******/ // no module.loaded needed 94/******/exports:{} 95/******/}; 96/******/ 97/******/ // Execute the module function 98/******/ 99/******/ 100/******/ // Return the exports of the module 101/******/return e[s](l,l.exports,n),l.exports; 102/******/} 103/******/ 104/************************************************************************/ 105/******/ /* webpack/runtime/define property getters */ 106/******/ 107/******/ // define getter/value functions for harmony exports 108/******/n.d=(e,t)=>{ 109/******/if(Array.isArray(t)) 110/******/for( 111/******/var s=0;s<t.length;){ 112/******/var o=t[s++],l=t[s++]; 113/******/ 114/******/n.o(e,o)?0===l&&s++ 115/******/: 116/******/0===l? 117/******/Object.defineProperty(e,o,{enumerable:!0,value:t[s++]}): 118/******/Object.defineProperty(e,o,{enumerable:!0,get:l}) 119/******/} 120/******/else 121/******/for(var o in t) 122/******/n.o(t,o)&&!n.o(e,o)&& 123/******/Object.defineProperty(e,o,{enumerable:!0,get:t[o]}) 124/******/; 125/******/ 126/******/}, 127/******/n.o=(e,t)=>Object.hasOwn(e,t) 128/******/; 129/* harmony import */n(29848); 130/** 131 * Internal dependencies 132 */window.addEventListener("load",()=>{if(0===document.querySelectorAll(".sensei-collapsible__toggle").length)return;
132document.querySelectorAll(".sensei-collapsible").forEach(e=>{const t=e.querySelector(".sensei-collapsible__content"),n=e.querySelector(".sensei-collapsible__toggle");if(!t||!n)return;let s=t.offsetHeight+"px";if(t.classList.contains("sensei-collapsed")){const e=t.style.transition;t.style.transition="unset",t.style.maxHeight="unset",s=t.offsetHeight+"px",t.style.visibility="hidden",t.style.maxHeight=0,t.style.transition=e}else t.style.maxHeight=s;n.addEventListener("click",e=>{e.preventDefault();const o=t.classList.toggle("sensei-collapsed");n.classList.toggle("sensei-collapsed",o),n.setAttribute("aria-expanded",!o),o?t.style.maxHeight="0px":(t.style.visibility="",t.style.maxHeight=s)}),t.addEventListener("transitionend",e=>{"max-height"===e.propertyName&&t.classList.contains("sensei-collapsed")&&(t.style.visibility="hidden")})})})})();
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.