1import{C as u,a as y}from"./engine-k1uunxGy.js";const d=new Map;function m(r){const t=r.querySelector(`.${u.track}`);if(!t)return;const e=Array.from(t.querySelectorAll(`:scope > .${u.slide}`));for(let o=e.length-1;o>0;o--){const i=Math.floor(Math.random()*(o+1));[e[o],e[i]]=[e[i],e[o]]}e.forEach(o=>t.appendChild(o))}function g(r){r.el.querySelectorAll(`.${u.slideDuplicate} .slide-content .heading`).forEach(t=>{if(t.tagName==="H3"||!/^H[1-6]$/.test(t.tagName))return;const e=getComputedStyle(t).marginBottom,o=document.createElement("h3");for(const i of Array.from(t.attributes))o.setAttribute(i.name,i.value);for(;t.firstChild;)o.appendChild(t.firstChild);o.style.marginBottom=e,t.replaceWith(o)})}function l(r){r.el.querySelectorAll(`.${u.slideDuplicate}`).forEach(e=>{e.getAttribute("aria-hidden")!=="true"&&e.setAttribute("aria-hidden","true"),e.getAttribute("tabindex")!=="-1"&&e.setAttribute("tabindex","-1"),e.hasAttribute("inert")||e.setAttribute("inert","")})}function f(r){r.slides.forEach((t,e)=>{e===r.realIndex?(t.removeAttribute("aria-hidden"),t.removeAttribute("tabindex"),t.removeAttribute("inert")):(t.getAttribute("aria-hidden")!=="true"&&t.setAttribute("aria-hidden","true"),t.getAttribute("tabindex")!=="-1"&&t.setAttribute("tabindex","-1"),t.hasAttribute("inert")||t.setAttribute("inert",""))})}function S(r,t){const e=r.classList.contains(u.root)?r:r.querySelector(`.${u.root}`);if(!e){console.error("[next:hero-carousel] no .carousel root found inside",r);return}if(d.has(e))return;const o=t&&typeof t=="object"?t:{},{randomOrder:i,...b}=o;i&&m(e);let a;try{a=new y(e,b)}catch(c){console.error("[next:hero-carousel] engine boot failed:",c);return}d.set(e,a),g(a),l(a),f(a),a.on("slideChange",()=>{l(a),f(a)}),a.on("transitionEnd",()=>{l(a),f(a)});const n=e.querySelector("[data-carousel-pause]");if(n){const c=n.querySelector(".slider-pause-control__icon"),p=n.dataset.pauseLabel??"Pause slideshow",A=n.dataset.playLabel??"Play slideshow";let s=!1;const h=()=>{n.setAttribute("aria-pressed",s?"true":"false"),n.setAttribute("aria-label",s?A:p),c&&(c.textContent=s?"â¶":"ââ")};typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(s=!0,a.autoplay.stop(),h()),n.addEventListener("click",()=>{s=!s,s?a.autoplay.stop():a.autoplay.start(),h()})}}function w(){for(const[r,t]of d)t.destroy(),d.delete(r)}export{w as destroy,S as initialize};
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.