PageSourceSearch

https://www.marinelayer.com/cdn/shop/t/378/assets/accordion.min.D5FYvjlc.min.js

js marinelayer.com collected 2026-09-24 19:52:26 UTC 7,008 bytes, 1 lines download raw bytes

1function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t,s,n={exports:{}};const i=e((t||(t=1,s=n,function(e){let t=0;const n=function(e,s){const i=this;let o=!1;if(Array.isArray(e))return!!e.length&&e.map(e=>new n(e,s));const r={init(){this.options=Object.assign({duration:500,ariaEnabled:!0,collapse:!0,showMultiple:!1,onlyChildNodes:!0,openOnInit:[],elementClass:"ac",triggerClass:"ac-trigger",panelClass:"ac-panel",activeClass:"is-active",beforeOpen:()=>{},onOpen:()=>{},beforeClose:()=>{},onClose:()=>{}},s);const t="string"==typeof e;this.container=t?document.querySelector(e):e,this.createDefinitions(),i.attachEvents()},createDefinitions(){const{elementClass:e,openOnInit:s,onlyChildNodes:n}=this.options,i=n?this.container.childNodes:this.container.querySelectorAll(a(e));this.elements=Array.from(i).filter(t=>t.classList&&t.classList.contains(e)),this.firstElement=this.elements[0],this.lastElement=this.elements[this.elements.length-1],this.elements.filter(e=>!e.classList.contains("js-enabled")).forEach(e=>{e.classList.add("js-enabled"),this.generateIDs(e),this.setARIA(e),this.setTransition(e);const n=this.elements.indexOf(e);t++,s.includes(n)?this.showElement(e,!1):this.closeElement(e,!1)})},setTransition(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{duration:s,panelClass:n}=this.options;e.querySelector(a(n)).style.transitionDuration=t?null:"".concat(s,"ms")},generateIDs(e){const{triggerClass:s,panelClass:n}=this.options,i=e.querySelector(a(s)),o=e.querySelector(a(n));e.setAttribute("id",e.id||"ac-".concat(t)),i.setAttribute("id",i.id||"ac-trigger-".concat(t)),o.setAttribute("id",o.id||"ac-panel-".concat(t))},removeIDs(e){const{triggerClass:t,panelClass:s}=this.options,n=e.querySelector(a(t)),i=e.querySelector(a(s));e.id.startsWith("ac-")&&e.removeAttribute("id"),n.id.startsWith("ac-")&&n.removeAttribute("id"),i.id.startsWith("ac-")&&i.removeAttribute("id")},setARIA(e){const{ariaEnabled:t,triggerClass:s,panelClass:n}=this.options;if(!t)return;const i=e.querySelector(a(s)),o=e.querySelector(a(n));i.setAttribute("role","button"),i.setAttribute("aria-controls",o.id),i.setAttribute("aria-disabled",!1),i.setAttribute("aria-expanded",!1),o.setAttribute("role","region"),o.setAttribute("aria-labelledby",i.id)},updateARIA(e,t){let{ariaExpanded:s,ariaDisabled:n}=t;const{ariaEnabled:i,triggerClass:o}=this.options;if(!i)return;const r=e.querySelector(a(o));r.setAttribute("aria-expanded",s),r.setAttribute("aria-disabled",n)},removeARIA(e){const{ariaEnabled:t,triggerClass:s,panelClass:n}=this.options;if(!t)return;const i=e.querySelector(a(s)),o=e.querySelector(a(n));i.removeAttribute("role"),i.removeAttribute("aria-controls"),i.removeAttribute("aria-disabled"),i.removeAttribute("aria-expanded"),o.removeAttribute("role"),o.removeAttribute("aria-labelledby")},focus(e,t){e.preventDefault();const{triggerClass:s}=this.options;t.querySelector(a(s)).focus()},focusFirstElement(e){this.focus(e,this.firstElement),this.currFocusedIdx=0},focusLastElement(e){this.focus(e,this.lastElement),this.currFocusedIdx=this.elements.length-1},focusNextElement(e){const t=this.currFocusedIdx+1;if(t>this.elements.length-1)return this.focusFirstElement(e);this.focus(e,this.elements[t]),this.currFocusedIdx=t},focusPrevElement(e){const t=this.currFocusedIdx-1;if(t<0)return this.focusLastElement(e);this.focus(e,this.elements[t]),this.currFocusedIdx=t},showElement(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{panelClass:s,activeClass:n,collapse:i,beforeOpen:o}=this.options;t&&o(e);const r=e.querySelector(a(s)),l=r.scrollHeight;e.classList.add(n),requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.style.height=t?"".concat(l,"px"):"auto"})}),this.updateARIA(e,{ariaExpanded:!0,ariaDisabled:!i})},closeElement(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{panelClass:s,activeClass:n,beforeClose:i}=this.options,o=e.querySelector(a(s)),r=o.scrollHeight;e.classList.remove(n),t?(i(e),requestAnimationFrame(()=>{o.style.height="".concat(r,"px"),requestAnimationFrame(()=>{o.style.height=0})})):o.style.height=0,this.updateARIA(e,{ariaExpanded:!1,ariaDisabled:!1})},toggleElement(e){const{activeClass:t,collapse:s}=this.options,n=e.classList.contains(t);if(!n||s)return n?this.closeElement(e):this.showElement(e)},closeElements(){const{activeClass:e,showMultiple:t}=this.options;
1t||this.elements.forEach((t,s)=>{t.classList.contains(e)&&s!==this.currFocusedIdx&&this.closeElement(t)})},handleClick(e){const t=e.currentTarget;this.elements.forEach((s,n)=>{s.contains(t)&&"A"!==e.target.nodeName&&(this.currFocusedIdx=n,this.closeElements(),this.focus(e,s),this.toggleElement(s))})},handleKeydown(e){switch(e.key){case"ArrowUp":return this.focusPrevElement(e);case"ArrowDown":return this.focusNextElement(e);case"Home":return this.focusFirstElement(e);case"End":return this.focusLastElement(e);default:return null}},handleFocus(e){const t=e.currentTarget,s=this.elements.find(e=>e.contains(t));this.currFocusedIdx=this.elements.indexOf(s)},handleTransitionEnd(e){if(e.stopPropagation(),"height"!==e.propertyName)return;const{onOpen:t,onClose:s}=this.options,n=e.currentTarget,i=parseInt(n.style.height),o=this.elements.find(e=>e.contains(n));i>0?(n.style.height="auto",t(o)):s(o)}};this.attachEvents=()=>{if(o)return;const{triggerClass:e,panelClass:t}=r.options;r.handleClick=r.handleClick.bind(r),r.handleKeydown=r.handleKeydown.bind(r),r.handleFocus=r.handleFocus.bind(r),r.handleTransitionEnd=r.handleTransitionEnd.bind(r),r.elements.forEach(s=>{const n=s.querySelector(a(e)),i=s.querySelector(a(t));n.addEventListener("click",r.handleClick),n.addEventListener("keydown",r.handleKeydown),n.addEventListener("focus",r.handleFocus),i.addEventListener("transitionend",r.handleTransitionEnd)}),o=!0},this.detachEvents=()=>{if(!o)return;const{triggerClass:e,panelClass:t}=r.options;r.elements.forEach(s=>{const n=s.querySelector(a(e)),i=s.querySelector(a(t));n.removeEventListener("click",r.handleClick),n.removeEventListener("keydown",r.handleKeydown),n.removeEventListener("focus",r.handleFocus),i.removeEventListener("transitionend",r.handleTransitionEnd)}),o=!1},this.toggle=e=>{const t=r.elements[e];t&&r.toggleElement(t)},this.open=e=>{const t=r.elements[e];t&&r.showElement(t)},this.openAll=()=>{const{activeClass:e,onOpen:t}=r.options;r.elements.forEach(s=>{s.classList.contains(e)||(r.showElement(s,!1),t(s))})},this.close=e=>{const t=r.elements[e];t&&r.closeElement(t)},this.closeAll=()=>{const{activeClass:e,onClose:t}=r.options;r.elements.forEach(s=>{s.classList.contains(e)&&(r.closeElement(s,!1),t(s))})},this.destroy=()=>{this.detachEvents(),this.openAll(),r.elements.forEach(e=>{r.removeIDs(e),r.removeARIA(e),r.setTransition(e,!0)}),o=!0},this.update=()=>{r.createDefinitions(),this.detachEvents(),this.attachEvents()};const a=e=>".".concat(CSS.escape(e));r.init()};void 0!==s.exports?s.exports=n:e.Accordion=n}(window)),n.exports));export{i as A};

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.