PageSourceSearch

https://marshallcf.org/wp-content/plugins/easy-accordion-pro/Block…/js/sp-eap-accordion.min.js?ver=4.2.7

js marshallcf.org collected 2026-10-01 23:58:16 UTC 16,962 bytes, 1 lines download raw bytes

1function eabHighlightText(e,n){if(!e||!n)return;eabClearHighlights(e);let r=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),i=new RegExp(r,`gi`),a=n.toLowerCase(),o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){return!e.nodeValue||e.nodeValue.toLowerCase().indexOf(a)===-1?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];for(;o.nextNode();)s.push(o.currentNode);s.forEach(e=>{let t=e.nodeValue,n=document.createDocumentFragment(),r=0;i.lastIndex=0;let a;for(;(a=i.exec(t))!==null;){a.index>r&&n.appendChild(document.createTextNode(t.slice(r,a.index)));let e=document.createElement(`span`);e.className=`sp-eab-highlight-text`,e.textContent=a[0],n.appendChild(e),r=a.index+a[0].length,a[0].length===0&&i.lastIndex++}r<t.length&&n.appendChild(document.createTextNode(t.slice(r))),e.parentNode.replaceChild(n,e)})}function eabClearHighlights(e){e&&e.querySelectorAll(`span.sp-eab-highlight-text`).forEach(e=>{let t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e),t.normalize()}})}class EabHelpers{constructor(){this.headingSelector=`.sp-eab-accordion-heading`}qs(e,t=!1){return t?t.querySelector(e):document.querySelector(e)}qsAll(e,t=!1){return t?t.querySelectorAll(e):document.querySelectorAll(e)}}class EabAccordion{constructor(e,t={}){this.container=e;let n=this.container.dataset.itemsContainer;if(n){let e=this.container.querySelector(n);this.items=e?e.querySelectorAll(`:scope > .sp-eab-accordion-item`):[]}else this.items=this.container.querySelectorAll(`:scope > .sp-eab-accordion-item`);this.options=Object.assign({openMultiItemAtaTime:!0,defaultAccordionOpen:`close-all`,selectedItemOpen:1,mode:`vertical`,activeEvent:`click`,transitionDuration:600,autoplayDuration:3e3,autoplayPauseOnHover:!0,scrollToTopOnLoad:!1,scrollToTopOnClick:!1,accordionItemToUrl:!1,animationEffect:!1,applyAccessibility:!0},t),this.isVerticalMode=this.options.mode===`vertical`,this.#accordionInit(),this.currentIndex=0,this.autoplayInterval=null,this.isAutoplayPaused=!1}#removeBoundEvent(e,t,n){if(!e)return;let r=n||`__eab_${t}_handler`,i=e[r];if(i){e.removeEventListener(t,i);try{delete e[r]}catch{}}}#bindEvent(e,t,n,r){if(!e||typeof n!=`function`)return;let i=r||`__eab_${t}_handler`;this.#removeBoundEvent(e,t,i),e.addEventListener(t,n),e[i]=n}#getFocusableElements(e){return[...e.querySelectorAll(`a[href], area[href], button, input:not([type="hidden"]), select, textarea, iframe`)].filter(e=>!e.disabled&&e.getAttribute(`aria-hidden`)!==`true`&&e.offsetParent!==null)}#applyAccessibilityAttributes(e,t){let n=e.querySelector(`.sp-eab-accordion-heading`),r=e.querySelector(`.sp-eab-accordion-content`),i=(e?.getAttribute(`id`))?.slice(-6)||t,a=`eab-trigger${i}`,o=`eab-content${i}`;n.setAttribute(`id`,a),n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.setAttribute(`aria-controls`,o),n.setAttribute(`aria-expanded`,`false`),n.setAttribute(`aria-disabled`,`false`),r.setAttribute(`id`,o),r.setAttribute(`role`,`region`),r.setAttribute(`aria-labelledby`,a),this.#bindEvent(n,`keydown`,n=>{let r=[...this.container.querySelectorAll(`.sp-eab-accordion-heading`)];switch(n.key!==`Tab`&&n.preventDefault(),n.key){case`Enter`:case` `:this.#toggleAccordionItem(e);break;case`ArrowDown`:case`ArrowRight`:r[t+1]&&r[t+1].focus();break;case`ArrowUp`:case`ArrowLeft`:r[t-1]&&r[t-1].focus();break;case`Home`:r[0].focus();break;case`End`:r[r?.length-1].focus();break;case`Tab`:if(n.shiftKey||e.classList.contains(`eab-expand`)&&this.#getFocusableElements(e))return;let i=r[t+1];i&&(n.preventDefault(),i.focus());break}},`__eabKeydownHandler`)}#toggleAriaControls(e,t=`true`){e.querySelector(`.sp-eab-accordion-heading`).setAttribute(`aria-expanded`,t)}#accordionInit(){let e=this.options.activeEvent,t=this.options.defaultAccordionOpen,n=window?.location?.href?.includes(`eab-accordion-`),r=this.isVerticalMode?`max-height: 0; transition: max-height ${this.options.transitionDuration||500}ms ease;`:`width: 0; transition: width ${this.options.transitionDuration||500}ms ease;`;if(t===`close-all`&&this.collapseAll(),this.items.forEach((t,n)=>{let i=t.querySelector(`.sp-eab-accordion-content`);i.style.cssText=r;let a=t.querySelector(`.sp-eab-accordion-heading`);this.#removeBoundEvent(a,`mouseenter`,`__eabToggleMouseenterHandler`),this.#removeBoundEvent(a,`click`,`__eabToggleClickHandler`),this.#removeBoundEvent(t,`mouseenter`,`__eabAutoplayPauseHandler`),this.#removeBoundEvent(t,`mouseleave`,`__eabAutoplayResumeHandler`),e===`hover`?this.#bindEvent(a,`mouseenter`,()=>this.#toggleAccordionItem(t),`__eabToggleMouseenterHandler`):e===`click`?this.#bindEvent(a,`click`,()=>this.#toggleAccordionItem(t),`__eabToggleClickHandler`):e===`auto`&&(this.#bindEvent(a,`click`,()=>this.#toggleAccordionItem(t),`__eabToggleClickHandler`),this.options.autoplayPauseOnHover)&&(this.#bindEvent(t,`mouseenter`,()=>this.#pauseAutoplay(),`__eabAutoplayPauseHandler`),this.#bindEvent(t,`mouseleave`,()=>this.#resumeAutoplay(),`__eabAutoplayResumeHandler`)),this.options.accordionItemToUrl&&(this.#accordionOpenByUrl(t),this.options.scrollToTopOnLoad&&this.#scrollItemIntoView(t)),this.isVerticalMode&&t.getAttribute(`data-default-open`)&&(this.#openAccordionItem(t),this.options.scrollToTopOnLoad&&this.#scrollItemIntoView(t));let o=t.querySelector(`.sp-eab-accordion-inner-close-button`);o&&this.#bindEvent(o,`click`,e=>{e.stopPropagation(),this.#closeAccordionItem(t)},`__eabCloseButtonHandler`),this.options.applyAccessibility&&this.#a
1pplyAccessibilityAttributes(t,n),t.querySelector(`.variations_form`)&&(i.style.overflowY=`auto`)}),e===`auto`&&this.#startAutoplay(),!n){if(t===`open-all`)this.expandAll();else if(t===`first-item`)this.#openAccordionItem(this.items[0]);else if(t===`open-selected-item`){let e=this.items[this.options.selectedItemOpen];e&&this.#openAccordionItem(e)}}}#toggleAccordionItem(e){if(this.options.activeEvent===`auto`){let t=Array.from(this.items).indexOf(e);t!==-1&&(this.currentIndex=t)}e.classList.contains(`eab-expand`)?this.#closeAccordionItem(e):(this.options.openMultiItemAtaTime||this.collapseAll(),this.#openAccordionItem(e),this.options.accordionItemToUrl&&this.#accordionToUrl(e))}#openAccordionItem(e){if(!e)return;this.#handleContentAnimation(e,`APPLY`);let t=e.querySelector(`.sp-eab-accordion-content`);e.classList.add(`eab-expand`),this.isVerticalMode?t.style.maxHeight=t.scrollHeight+`px`:t.style.width=t.scrollWidth+`px`,this.options.scrollToTopOnClick&&setTimeout(()=>{this.#scrollItemIntoView(e)},this.options.transitionDuration+50),this.options.applyAccessibility&&this.#toggleAriaControls(e,`true`)}#closeAccordionItem(e){this.#handleContentAnimation(e,`REMOVE`);let t=e.querySelector(`.sp-eab-accordion-content`);e.classList.remove(`eab-expand`),this.isVerticalMode?t.style.maxHeight=`0px`:t.style.width=`0px`,this.options.applyAccessibility&&this.#toggleAriaControls(e,`false`)}expandAll(){this.items.forEach(e=>this.#openAccordionItem(e))}collapseAll(){this.items.forEach(e=>this.#closeAccordionItem(e))}#startAutoplay(){this.autoplayInterval=setInterval(()=>{if(this.isAutoplayPaused)return;this.collapseAll();let e=this.items[this.currentIndex];this.#openAccordionItem(e),this.currentIndex=(this.currentIndex+1)%this.items.length},this.options.autoplayDuration)}#pauseAutoplay(){this.isAutoplayPaused=!0}#resumeAutoplay(){this.isAutoplayPaused=!1}#scrollItemIntoView(e){let t=e.getBoundingClientRect(),n=window.pageYOffset+t.top-300;window.scrollTo({top:n,behavior:`smooth`})}#accordionToUrl(e){let t=e.querySelector(`.sp-eab-accordion-header-wrapper`)?.getAttribute(`data-slug`);if(t){let e=window.location.href.split(`#`)[0]+t;window.location.href=e}}#accordionOpenByUrl(e){let t=window.location?.href?.split(`#`)[1]||``;e.querySelector(`.sp-eab-accordion-header-wrapper`)?.getAttribute(`data-slug`)===`#${t}`&&this.#openAccordionItem(e)}#handleContentAnimation(e,t){let n=this.options.animationEffect,r=e?.querySelector(`.sp-eab-accordion-content-wrapper`);!n||!r||(t===`APPLY`?r.classList.add(`animated`,n):t===`REMOVE`&&r.classList.remove(`animated`,n))}}class EabAjaxPagination{constructor(e,t){this.parentBlock=e,this.accordionItems=t,this.buttonsWrapper=this.parentBlock.querySelector(`.sp-eab-pagination-buttons`),this.paginationWrapper=this.parentBlock.querySelector(`.sp-eab-pagination-wrapper`),this.options=JSON.parse(this.paginationWrapper.getAttribute(`data-pagination`)||`{}`),this.totalItems=t.length,this.itemsPerPage=this.options.itemsPerPage,this.isPost=this.parentBlock.querySelector(`.sp-eab-product-accordion-one,.sp-eab-post-accordion-one,.sp-eab-post-accordion-two, .sp-eab-post-accordion-two-template-one, .sp-eab-post-accordion-two-template-three`),this.isPost?this.totalPages=Math.ceil(this.isPost.dataset.totalPage):this.totalPages=Math.ceil(this.totalItems/this.options.itemsPerPage);let n=this.parentBlock.querySelector(`.sp-eab-ajax-pagination-block`);this.totalPages>1?(n?.classList.remove(`sp-d-hidden`),this.#init()):n?.parentElement?.remove()}#init(){this.options.paginationButtonType===`number`?(this.options.paginationNumberType!==`prev-next`&&this.#initNumberPagination(),this.#handleNumberPaginationClick()):this.#initLoadMore()}#showRange(e,t){this.accordionItems?.forEach((n,r)=>{n.style.display=r>=e&&r<t?`block`:`none`})}#initNumberPagination(){for(let e=1;e<=this.totalPages;e++){let t=document.createElement(`a`);if(t.href=`#`,t.className=`eab-pagination-item${e===1?` current`:``}`,t.innerText=e,t.dataset.value=e,this.buttonsWrapper.appendChild(t),e===this.totalPages){let e=this.buttonsWrapper.querySelector(`.next-prev-button.next-button`);e&&this.buttonsWrapper.appendChild(e)}}}#handleNumberPaginationClick(){let e=this.buttonsWrapper.querySelectorAll(`.eab-pagination-item:not(.next-prev-button)`),t=this.buttonsWrapper.querySelector(`.eab-pagination-item.prev-button`),n=this.buttonsWrapper.querySelector(`.eab-pagination-item.next-button`);this.isPost||this.#showRange(0,this.itemsPerPage);let r=r=>{if(!(r<1||r>this.totalPages)){if(this.buttonsWrapper.dataset.page=r,e?.forEach(e
1=>{e.classList.toggle(`current`,parseInt(e.dataset.value)===r)}),!this.isPost){let e=(r-1)*this.itemsPerPage;this.#showRange(e,e+this.itemsPerPage)}t&&t.classList.toggle(`sp-d-disabled`,r===1),n&&n.classList.toggle(`sp-d-disabled`,r===this.totalPages)}};e?.forEach(e=>{e.addEventListener(`click`,t=>{t.preventDefault(),r(parseInt(e.dataset.value))})}),t?.addEventListener(`click`,e=>{e.preventDefault(),t.classList.contains(`sp-d-disabled`)||r(parseInt(this.buttonsWrapper.dataset.page)-1)}),n?.addEventListener(`click`,e=>{e.preventDefault(),n.classList.contains(`sp-d-disabled`)||r(parseInt(this.buttonsWrapper.dataset.page)+1)}),r(1)}#initLoadMore(){let e=this.itemsPerPage,t=e;this.isPost||this.#showRange(0,e);let n=this.parentBlock.querySelector(`.sp-eab-load-more-button`);n.addEventListener(`click`,r=>{r.preventDefault(),this.isPost||(t+=e,this.#showRange(0,t),t>=this.totalItems&&(n.innerHTML=this.options.endingMessage))})}}class EabFAQSearch{constructor(e,t){this.searchBlock=e,this.accordionBlock=t;let n=e=>this.searchBlock.querySelector(e);this.button=n(`.sp-eab-faq-search-button`),this.input=n(`.sp-eab-faq-search-input`),this.suggestionBox=n(`.sp-eab-faq-search-suggestion-wrapper`),this.isPost=this.accordionBlock.querySelector(`.sp-eab-product-accordion-one,.sp-eab-post-accordion-one,.sp-eab-post-accordion-two, .sp-eab-post-accordion-two-template-one, .sp-eab-post-accordion-two-template-three`),!this.isPost&&(this.accordionItems=this.accordionBlock.querySelectorAll(`.sp-eab-accordion-item`),this.paginationBlock=this.accordionBlock.querySelector(`.sp-eab-ajax-pagination-block`),this.isSelectingSuggestion=!1,this.#initEvents())}#runSearch(e){let t=this.paginationBlock;if(e===`remove`){this.#showInitialItems(),this.#clearAllHighlights(),t&&t.classList.contains(`sp-d-hidden`)&&t.classList.remove(`sp-d-hidden`);return}let n=this.input.value.trim().toLowerCase();this.accordionItems.forEach(e=>{let t=e.querySelector(`.sp-eab-accordion-title-text`),r=e.querySelector(`.sp-eab-accordion-body`),i=t?.textContent?.toLowerCase(),a=r?.textContent?.toLowerCase(),o=i?.includes(n)||a?.includes(n);e.style.display=o?`block`:`none`,o&&(this.#highlightSearchText(t,n),this.#highlightSearchText(r,n))}),t&&!t.classList.contains(`sp-d-hidden`)&&t.classList.add(`sp-d-hidden`)}#showInitialItems(){let e=this.accordionBlock.querySelector(`.sp-eab-pagination-wrapper`),t=JSON.parse(e?.dataset?.pagination||`{}`)?.itemsPerPage;this.accordionItems.forEach((e,n)=>{e.style.display=!t||n<t?`block`:`none`})}#initEvents(){this.button?.addEventListener(`click`,()=>this.#runSearch(`search`)),this.input?.addEventListener(`keyup`,e=>{if(this.#runSearch(this.input.value.trim()===``?`remove`:`search`),this.suggestionBox){if(e.key===`Enter`){this.#toggleSuggestionBox(!1);return}this.#displaySuggestionBox(this.input.value)}}),this.suggestionBox&&document.addEventListener(`click`,e=>{this.suggestionBox.contains(e.target)||this.#toggleSuggestionBox(!1)})}#displaySuggestionBox(e){let t=e.trim().toLowerCase();if(!t)return this.#clearSuggestionBox();this.#toggleSuggestionBox(!0),this.suggestionBox.innerHTML=``;let n=!1;this.accordionItems.forEach(e=>{let r=e.querySelector(`.sp-eab-accordion-title-text`),i=e.querySelector(`.sp-eab-accordion-body`),a=r?.textContent.trim();a?.toLowerCase()?.includes(t)&&(n=!0,this.#appendItemOnSuggestionBox(a)),(i?.textContent.trim())?.toLowerCase()?.includes(t)&&(n=!0)}),n||this.#appendItemOnSuggestionBox(`No FAQ found`,!0)}#toggleSuggestionBox(e){this.suggestionBox.classList.replace(e?`sp-d-hidden`:`sp-d-flex`,e?`sp-d-flex`:`sp-d-hidden`)}#clearSuggestionBox(){this.suggestionBox.innerHTML=``,this.#toggleSuggestionBox(!1)}#appendItemOnSuggestionBox(e,t=!1){let n=document.createElement(`li`);n.className=`sp-eab-search-suggestion-item${t?` no-data`:``}`,n.textContent=e,t||n.addEventListener(`click`,t=>{t.preventDefault(),this.input.value=e,this.#clearSuggestionBox(),this.#runSearch(`search`)}),this.suggestionBox.appendChild(n)}#highlightSearchText(t,n){eabHighlightText(t,n)}#clearAllHighlights(){this.accordionItems.forEach(e=>{eabClearHighlights(e.querySelector(`.sp-eab-accordion-title-text`)),eabClearHighlights(e.querySelector(`.sp-eab-accordion-body`))})}}
1class EabTabAccordion extends EabHelpers{constructor(e,t={}){super(),this.block=e,this.options=Object.assign({defaultOpenItem:`first-item`,selectedItemOpen:1,activeEvent:`click`,transitionDuration:600,autoplayDuration:3e3,scrollToTopOnLoad:!1,accordionItemToUrl:!1,contentHeight:`auto`,template:``},t),this.headings=this.qsAll(this.headingSelector,this.block),this.allContents=this.qsAll(`.sp-eab-sidebar-tab-item`,this.block),this.#initBlock()}#initBlock(){if(this.headings.forEach((e,t)=>{let n=this.options.activeEvent===`hover`?`mouseenter`:`click`;e.addEventListener(n,()=>{this.#openTabItem(e)});let r=t+1;this.options.defaultOpenItem===`first-item`&&r===1&&this.#openTabItem(e),this.options.defaultOpenItem===`open-selected-item`&&r===parseInt(this.options.selectedItemOpen)&&this.#openTabItem(e)}),this.options.contentHeight===`auto`){let e=this.qs(`.sp-eab-sidebar-tabs-content`,this.block),t=this.qs(`.sp-eab-sidebar-tabs-nav`,this.block);e.style.minHeight=`${t.offsetHeight}px`}}#openTabItem(e){let t=e?.getAttribute(`data-tabid`);if(!t)return;this.headings?.forEach(e=>e.classList.remove(`eab-expand`)),e.classList.add(`eab-expand`);let n=this.qs(`#${t}`,this.block);if(this.allContents?.forEach(e=>e.classList.remove(`eab-expand`)),n.classList.add(`eab-expand`),this.options.template===`sidebar-tab-accordion-one`){let t=e.closest(`.sp-eab-sidebar-tabs-nav`),r=n.closest(`.sp-eab-sidebar-tabs-content`);if(!t||!r)return;let i=parseFloat(window.getComputedStyle(this.block).gap),a=`0`;(r?.offsetHeight>t?.offsetHeight||i>0)&&(a=``),r.style.borderBottomLeftRadius=a}}}class EabMenuAccordion extends EabHelpers{constructor(e,t={}){super(),this.block=e,this.options=Object.assign({multipleOpenTogether:!1},t),this.#bindEvents()}#bindEvents(){this.qsAll(`.eab-menu-accordion__item`,this.block)?.forEach(e=>{let t=this.qs(`.eab-menu-accordion__heading`,e),n=this.qs(`.eab-menu-accordion__content`,e);!t||!n||t.addEventListener(`click`,t=>{t.stopPropagation();let n=e.classList.contains(`eab-expand`);if(!this.options.multipleOpenTogether){let t=e.parentElement;t&&this.qsAll(`:scope > .eab-menu-accordion__item`,t).forEach(t=>{t!==e&&this.#closeMenuItem(t)})}n?this.#closeMenuItem(e):this.#openMenuItem(e)})})}#openMenuItem(e){let t=this.qs(`.eab-menu-accordion__content`,e),n=this.qs(`.eab-menu-accordion__wrapper`,e);!t||!n||(t.style.maxHeight=n.scrollHeight+`px`,e.classList.add(`eab-expand`),t.addEventListener(`transitionend`,()=>{e.classList.contains(`eab-expand`)&&(t.style.maxHeight=`none`)},{once:!0}))}#closeMenuItem(e){let t=this.qs(`.eab-menu-accordion__content`,e);t&&(t.style.maxHeight=t.scrollHeight+`px`,requestAnimationFrame(()=>{t.style.maxHeight=`0px`}),e.classList.remove(`eab-expand`))}}

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.